mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 18:00:37 +02:00
express spawn fn as spawn fut (#256)
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
use std::time::Duration;
|
||||
use std::{io, thread};
|
||||
|
||||
use actix_rt::time::{sleep_until, Instant};
|
||||
use actix_rt::System;
|
||||
use actix_rt::{
|
||||
time::{sleep_until, Instant},
|
||||
System,
|
||||
};
|
||||
use log::{error, info};
|
||||
use mio::{Interest, Poll, Token as MioToken};
|
||||
use slab::Slab;
|
||||
@ -401,10 +403,11 @@ impl Accept {
|
||||
|
||||
// after the sleep a Timer interest is sent to Accept Poll
|
||||
let waker = self.waker.clone();
|
||||
System::current().arbiter().spawn(Box::pin(async move {
|
||||
System::current().worker().spawn(async move {
|
||||
sleep_until(Instant::now() + Duration::from_millis(510)).await;
|
||||
waker.wake(WakerInterest::Timer);
|
||||
}));
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user