pub trait ProcessService:
Send
+ Sync
+ Debug {
// Required methods
fn shutdown_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown_own_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for process-level service operations.
Any process that participates in the IPC system should implement this trait to handle graceful shutdown requests.
Two distinct shutdown operations are provided:
shutdown_tree: Shuts down the entire application/workspace. This is a privileged operation typically reserved for workspace-level processes.shutdown_own_tree: Shuts down only the calling process and its owned descendants. This allows processes to terminate themselves and their children without affecting the entire application.
Required Methods§
Sourcefn shutdown_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request graceful shutdown of the entire application/workspace.
This is a privileged operation that triggers a full application shutdown. Only processes with appropriate capabilities should be allowed to invoke this method.
Sourcefn shutdown_own_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown_own_tree<'life0, 'async_trait>(
&'life0 self,
request: ShutdownTreeRequest,
) -> Pin<Box<dyn Future<Output = Result<ShutdownTreeResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request graceful shutdown of the calling process and its descendants.
This allows a process to shut down itself and any child processes it owns, without affecting other parts of the application. This is the standard shutdown operation for most processes.