[][src]Trait executor_trait::BlockingExecutor

pub trait BlockingExecutor {
#[must_use]    pub fn spawn_blocking<'life0, 'async_trait>(
        &'life0 self,
        f: Box<dyn FnOnce() + Send + 'static>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

A common interface for spawning blocking tasks on top of an executor

Required methods

#[must_use]pub fn spawn_blocking<'life0, 'async_trait>(
    &'life0 self,
    f: Box<dyn FnOnce() + Send + 'static>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Convert a blocking task into a future, spawning it on a decicated thread pool

Loading content...

Implementors

impl<E: Deref + Sync> BlockingExecutor for E where
    E::Target: BlockingExecutor + Sync
[src]

Loading content...