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.
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.