Skip to main content

Supervisable

Trait Supervisable 

Source
pub trait Supervisable: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn initialize(
        &self,
        process_shutdown: ProcessShutdown,
    ) -> Option<SupervisorFuture>;

    // Provided method
    fn shutdown_strategy(&self) -> ShutdownStrategy { ... }
}
Expand description

A supervisable process.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of the process.

Source

fn initialize( &self, process_shutdown: ProcessShutdown, ) -> Option<SupervisorFuture>

Initialize a Future that represents the execution of the process.

When Some is returned, the process is spawned and managed by the supervisor. When None is returned, the process is considered to be permanently failed. This can be useful for supervised tasks that are not expected to ever fail, or cannot support restart, but should still be managed within the same supervision hierarchy as other processes.

Provided Methods§

Source

fn shutdown_strategy(&self) -> ShutdownStrategy

Defines the shutdown strategy for the process.

Implementors§