Struct backdrop::TokioBlockingTaskStrategy
source · pub struct TokioBlockingTaskStrategy();Available on crate feature
tokio only.Expand description
Strategy which spawns a new ‘blocking’ tokio task which drops the contained value.
This only works within the context of a Tokio runtime. (Dropping objects constructed with this strategy while no Tokio runtime is available will result in a panic!)
This strategy is similar to TokioTaskStrategy but uses tokio::task::spawn_blocking
instead. This makes sure that the ‘fast async tasks’ thread pool can continue its normal work,
because the drop work is passed to the ‘ok to block here’ thread pool.
Benchmark to find out which approach suits your scenario better!