Trait cfx_tasks::TaskSpawnerExt
source · pub trait TaskSpawnerExt: Send + Sync + Unpin + Debug + DynClone {
// Required methods
fn spawn_critical_with_graceful_shutdown_signal<F>(
&self,
name: &'static str,
f: impl FnOnce(GracefulShutdown) -> F
) -> JoinHandle<()>
where F: Future<Output = ()> + Send + 'static;
fn spawn_with_graceful_shutdown_signal<F>(
&self,
f: impl FnOnce(GracefulShutdown) -> F
) -> JoinHandle<()>
where F: Future<Output = ()> + Send + 'static;
}
Expand description
TaskSpawner
with extended behaviour
Required Methods§
sourcefn spawn_critical_with_graceful_shutdown_signal<F>(
&self,
name: &'static str,
f: impl FnOnce(GracefulShutdown) -> F
) -> JoinHandle<()>
fn spawn_critical_with_graceful_shutdown_signal<F>( &self, name: &'static str, f: impl FnOnce(GracefulShutdown) -> F ) -> JoinHandle<()>
This spawns a critical task onto the runtime.
If this task panics, the TaskManager
is notified.
The TaskManager
will wait until the given future has completed
before shutting down.
sourcefn spawn_with_graceful_shutdown_signal<F>(
&self,
f: impl FnOnce(GracefulShutdown) -> F
) -> JoinHandle<()>
fn spawn_with_graceful_shutdown_signal<F>( &self, f: impl FnOnce(GracefulShutdown) -> F ) -> JoinHandle<()>
This spawns a regular task onto the runtime.
The TaskManager
will wait until the given future has completed
before shutting down.
Object Safety§
This trait is not object safe.