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!
Trait Implementations§
source§impl<T: Send + 'static> BackdropStrategy<T> for TokioBlockingTaskStrategy
impl<T: Send + 'static> BackdropStrategy<T> for TokioBlockingTaskStrategy
Auto Trait Implementations§
impl RefUnwindSafe for TokioBlockingTaskStrategy
impl Send for TokioBlockingTaskStrategy
impl Sync for TokioBlockingTaskStrategy
impl Unpin for TokioBlockingTaskStrategy
impl UnwindSafe for TokioBlockingTaskStrategy
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.