enough-tokio
Tokio integration for the [enough] cancellation trait.
This crate provides adapters between tokio's cancellation primitives
and the [Stop] trait.
Wrapping Tokio's CancellationToken
use TokioStop;
use Stop;
use CancellationToken;
let token = new;
let stop = new;
// Use in blocking context
spawn_blocking;
// Cancel from async context
token.cancel;
Async Waiting
use TokioStop;
let stop = new;
// Wait for cancellation in async code
stop.cancelled.await;