pub async fn spawn_cancelable(
        future: impl Future<Output = StrResult> + Send + 'static,
    ) -> StrResult {
        // this channel is actually never used. cancel_receiver will be notified when _cancel_sender
        // is dropped
        let (_cancel_sender, cancel_receiver) = oneshot::channel::<()>();

        trace_err!(
            task::spawn(async {
                tokio::select! {
                    res = future => res,
                    _ = cancel_receiver => Ok(()),
                }
            })
            .await
        )?
    }
// Tokio tasks are not cancelable. This function awaits a cancelable task.
Tokio tasks are not cancelable. This function awaits a cancelable task.
Tokio tasks are not cancelable . This function awaits a cancelable task .
pub async fn spawn_cancelable(
        future: impl Future<Output = StrResult> + Send + 'static,
    ) -> StrResult {
        // this channel is actually never used. cancel_receiver will be notified when _cancel_sender
        // is dropped
        let (_cancel_sender, cancel_receiver) = oneshot::channel::<()>();
        trace_err!(
            task::spawn(async {
                tokio::select! {
                    res = future => res,
                    _ = cancel_receiver => Ok(()),
                }
            })
            .await
        )?
    }
pub async fn spawn_cancelable ( future : impl Future < Output = StrResult > + Send + ' static , ) -> StrResult { // this channel is actually never used. cancel_receiver will be notified when _cancel_sender // is dropped let ( _cancel_sender , cancel_receiver ) = oneshot :: channel :: < ( ) > ( ) ; trace_err ! ( task spawn ( async { tokio select { res future res cancel_receiver Ok ( ( ) ) } } ) await ) ? }
Tokio tasks are not cancelable.
Tokio tasks are not cancelable .
future
impl Future<Output = StrResult> + Send + 'static