Trait aleph_bft_types::SpawnHandle
source · pub trait SpawnHandle: Clone + Send + 'static {
// Required methods
fn spawn(
&self,
name: &'static str,
task: impl Future<Output = ()> + Send + 'static
);
fn spawn_essential(
&self,
name: &'static str,
task: impl Future<Output = ()> + Send + 'static
) -> TaskHandle;
}
Expand description
An abstraction for an execution engine for Rust’s asynchronous tasks.
Required Methods§
sourcefn spawn(
&self,
name: &'static str,
task: impl Future<Output = ()> + Send + 'static
)
fn spawn( &self, name: &'static str, task: impl Future<Output = ()> + Send + 'static )
Run a new task.
sourcefn spawn_essential(
&self,
name: &'static str,
task: impl Future<Output = ()> + Send + 'static
) -> TaskHandle
fn spawn_essential( &self, name: &'static str, task: impl Future<Output = ()> + Send + 'static ) -> TaskHandle
Run a new task and returns a handle to it. If there is some error or panic during execution of the task, the handle should return an error.
Object Safety§
This trait is not object safe.