Skip to main content

run_task_with_cancel

Function run_task_with_cancel 

Source
pub async fn run_task_with_cancel(
    config: &TaskConfig,
    cancel_token: Option<CancellationToken>,
) -> Result<StreamHandle>
Expand description

Run a task with an optional cancellation token.

Returns a StreamHandle containing the event stream and the cancel token. If no token is provided, a new one is created internally.