1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

Refactor LocalWaker (#224)

This commit is contained in:
Juan Aguilar
2020-12-13 20:26:57 +01:00
committed by GitHub
parent 049795662f
commit 02a902068f
7 changed files with 21 additions and 16 deletions

View File

@ -286,7 +286,7 @@ impl ServerBuilder {
// handle signals
if !self.no_signals {
Signals::start(self.server.clone()).unwrap();
Signals::start(self.server.clone());
}
// start http server actor

View File

@ -1,5 +1,4 @@
use std::future::Future;
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
@ -24,13 +23,13 @@ pub(crate) enum Signal {
pub(crate) struct Signals {
srv: Server,
#[cfg(not(unix))]
stream: Pin<Box<dyn Future<Output = io::Result<()>>>>,
stream: Pin<Box<dyn Future<Output = std::io::Result<()>>>>,
#[cfg(unix)]
streams: Vec<(Signal, actix_rt::signal::unix::Signal)>,
}
impl Signals {
pub(crate) fn start(srv: Server) -> io::Result<()> {
pub(crate) fn start(srv: Server) {
actix_rt::spawn(lazy(|_| {
#[cfg(not(unix))]
{
@ -66,8 +65,6 @@ impl Signals {
actix_rt::spawn(Signals { srv, streams })
}
}));
Ok(())
}
}