Skip to main content

spawn_monitored_task

Function spawn_monitored_task 

Source
pub fn spawn_monitored_task<F, Fut>(
    task_id: u32,
    task_name: impl Into<String>,
    error_tx: Sender<StreamError>,
    run: F,
) -> JoinHandle<()>
where F: FnOnce() -> Fut + Send + 'static, Fut: Future<Output = StreamResult<()>> + Send + 'static,
Expand description

Run run on an inner task; propagate Err, panic, or cancellation to error_tx.