pub trait Supervisable: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn initialize<'life0, 'async_trait>(
&'life0 self,
process_shutdown: ProcessShutdown,
) -> Pin<Box<dyn Future<Output = Result<SupervisorFuture, InitializationError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn shutdown_strategy(&self) -> ShutdownStrategy { ... }
}Expand description
A supervisable process.
Required Methods§
Sourcefn initialize<'life0, 'async_trait>(
&'life0 self,
process_shutdown: ProcessShutdown,
) -> Pin<Box<dyn Future<Output = Result<SupervisorFuture, InitializationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
process_shutdown: ProcessShutdown,
) -> Pin<Box<dyn Future<Output = Result<SupervisorFuture, InitializationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initializes the process asynchronously.
During initialization, any resources or configuration for the process can be created asynchronously, and the
same runtime that is used for running the process is used for initialization. The resulting future is expected
to complete as soon as reasonably possible after process_shutdown resolves.
§Errors
If the process cannot be initialized, an error is returned.
Provided Methods§
Sourcefn shutdown_strategy(&self) -> ShutdownStrategy
fn shutdown_strategy(&self) -> ShutdownStrategy
Returns the shutdown strategy for the process.