spawn_listener

Function spawn_listener 

Source
pub fn spawn_listener<T, S>(
    handle: GenServerHandle<T>,
    stream: S,
) -> JoinHandle<()>
where T: GenServer, S: Send + Stream<Item = T::CastMsg> + 'static,
Expand description

Spawns a listener that listens to a stream and sends messages to a GenServer.

Items sent through the stream are required to be wrapped in a Result type.

This function returns a handle to the spawned task and a cancellation token to stop it.