Skip to main content

spawn_coroutine_with_buffer

Function spawn_coroutine_with_buffer 

Source
pub fn spawn_coroutine_with_buffer<T, F, Fut>(
    buffer: usize,
    f: F,
) -> CommunicationTask<T>
where F: FnMut(Receiver<T>) -> Fut, Fut: Future<Output = ()> + Send + 'static,
Expand description

Spawns a new asynchronous task with a set channel buffer that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.