Skip to main content

accept_loop

Function accept_loop 

Source
pub async fn accept_loop<F>(
    listener: UnixListener,
    on_message: F,
    shutdown: Receiver<()>,
)
Expand description

Accept connections on the given UnixListener until shutdown is signalled.

Each connection is handled in a separate task. For each incoming ClientMessage, calls on_message(msg, reply_tx) where reply_tx is the per-connection sender for streaming ServerMessages back.