TaskRuntime

Trait TaskRuntime 

Source
pub trait TaskRuntime:
    'static
    + Send
    + Sync {
    // Required method
    fn spawn_task(
        &self,
        kind: TaskType,
        task: impl Future<Output = ()> + Send + 'static,
    );
}
Expand description

Something where we can put in async functions and have them execute eventually.

All of our task functions are either of the type “perform some computation and return” or of the type “perform some blocking IO and computation and return”. Regular blocking IO is used, not any kind of async IO.

Required Methods§

Source

fn spawn_task( &self, kind: TaskType, task: impl Future<Output = ()> + Send + 'static, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Send + 'static> TaskRuntime for Switchyard<T>

Source§

fn spawn_task( &self, kind: TaskType, task: impl Future<Output = ()> + Send + 'static, )

Implementors§