pub fn spawn<L, S>(listen: L, server: S, drain: drain::Watch)
where
    L: ListenAndSpawn + Send + 'static,
    S: ServeConnection<L::Connection> + Send + 'static,
{
    let serve = listen
        .listen_and_spawn(server, drain.clone())
        .map_err(|e| error!("failed to listen for connection: {}", e));

    // As soon as we get a shutdown signal, the listener task completes and
    // stops accepting new connections.
    let fut = drain.watch(Cancelable::new(serve), |c| c.cancel());
    linkerd2_task::spawn(fut);
}
/// Spawns a task that binds an `S`-typed server with an `L`-typed listener until
/// a drain is signaled.
Spawns a task that binds an `S`-typed server with an `L`-typed listener until
a drain is signaled.
Spawns a task that binds an ` S ` - typed server with an ` L ` - typed listener until a drain is signaled .
pub fn spawn<L, S>(listen: L, server: S, drain: drain::Watch)
where
    L: ListenAndSpawn + Send + 'static,
    S: ServeConnection<L::Connection> + Send + 'static,
{
    let serve = listen
        .listen_and_spawn(server, drain.clone())
        .map_err(|e| error!("failed to listen for connection: {}", e));
    // As soon as we get a shutdown signal, the listener task completes and
    // stops accepting new connections.
    let fut = drain.watch(Cancelable::new(serve), |c| c.cancel());
    linkerd2_task::spawn(fut);
}
pub fn spawn < L , S > ( listen : L , server : S , drain : drain :: Watch ) where L : ListenAndSpawn + Send + ' static , S : ServeConnection < L :: Connection > + Send + ' static , { let serve = listen . listen_and_spawn ( server , drain . clone ( ) ) . map_err ( | e | error ! ( " " e ) ) ; // As soon as we get a shutdown signal, the listener task completes and // stops accepting new connections. let fut = drain . watch ( Cancelable :: new ( serve ) , | c | c . cancel ( ) ) ; linkerd2_task :: spawn ( fut ) ; }
Spawns a task that binds an `S`-typed server with an `L`-typed listener until
a drain is signaled.
Spawns a task that binds an ` S ` - typed server with an ` L ` - typed listener until a drain is signaled .
listen
L
server
S
drain
drain::Watch
listen
L
server
S
drain
drain::Watch