Simple example

This commit is contained in:
Quentin 2022-06-03 14:32:10 +02:00
parent 25d0d3c79c
commit 0c5cea017b
Signed by: quentin
GPG key ID: E9602264D639FF68

View file

@ -10,6 +10,11 @@ async fn handle_req(req: Request) -> Result<Response> {
tracing::debug!("Got request: {:#?}", req); tracing::debug!("Got request: {:#?}", req);
use tokio::time::{sleep, Duration};
println!("WILL SLEEP");
sleep(Duration::from_millis(100)).await;
println!("DONE SLEEP");
let capabilities = vec![Capability::Imap4Rev1, Capability::Idle]; let capabilities = vec![Capability::Imap4Rev1, Capability::Idle];
let body = vec![Data::Capability(capabilities)]; let body = vec![Data::Capability(capabilities)];
@ -17,7 +22,7 @@ async fn handle_req(req: Request) -> Result<Response> {
} }
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> Result<()> {
tracing_subscriber::fmt::init(); tracing_subscriber::fmt::init();
let incoming = AddrIncoming::new("127.0.0.1:4567") let incoming = AddrIncoming::new("127.0.0.1:4567")