[web] Use the asyncio block_on
This commit is contained in:
parent
adcbae08ca
commit
57e1b5c85b
|
@ -10,6 +10,7 @@ pronouns_today = {path = ".."}
|
||||||
async-scgi = "0.1.0"
|
async-scgi = "0.1.0"
|
||||||
async-executor = "1.4"
|
async-executor = "1.4"
|
||||||
async-net = "1.6"
|
async-net = "1.6"
|
||||||
|
async-io = "1.6"
|
||||||
futures-lite = "1.12"
|
futures-lite = "1.12"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
|
|
|
@ -8,6 +8,7 @@ use async_net::unix::UnixListener;
|
||||||
use crate::configuration::Conf;
|
use crate::configuration::Conf;
|
||||||
use std::io::IoSlice;
|
use std::io::IoSlice;
|
||||||
use crate::statics::StaticAsset;
|
use crate::statics::StaticAsset;
|
||||||
|
use async_io::block_on;
|
||||||
use async_net::TcpListener;
|
use async_net::TcpListener;
|
||||||
use async_executor::LocalExecutor;
|
use async_executor::LocalExecutor;
|
||||||
use futures_lite::io::AsyncWriteExt;
|
use futures_lite::io::AsyncWriteExt;
|
||||||
|
@ -69,7 +70,7 @@ fn main() {
|
||||||
|
|
||||||
let executor = LocalExecutor::new();
|
let executor = LocalExecutor::new();
|
||||||
log::info!("Starting with configuration {:?}", config);
|
log::info!("Starting with configuration {:?}", config);
|
||||||
futures_lite::future::block_on(executor.run(start_server(config, &executor))).unwrap();
|
block_on(executor.run(start_server(config, &executor))).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue