pub struct SupervisionTree { /* private fields */ }Expand description
In-memory model of Aion’s three-level supervision structure.
The real cancellation and crash behavior is provided by beamr links through the runtime boundary. This tree records Aion’s intended parent-child shape: one engine supervisor, one supervisor per distinct workflow type, workflow processes under their type supervisor, and linked activity children directly under each workflow process.
Implementations§
Source§impl SupervisionTree
impl SupervisionTree
Sourcepub const fn engine_supervisor(&self) -> EngineSupervisorId
pub const fn engine_supervisor(&self) -> EngineSupervisorId
Identifier for the single engine supervisor root.
Sourcepub fn ensure_type_supervisor(
&self,
workflow_type: impl Into<String>,
) -> Result<TypeSupervisorId, EngineError>
pub fn ensure_type_supervisor( &self, workflow_type: impl Into<String>, ) -> Result<TypeSupervisorId, EngineError>
Ensure there is exactly one supervisor for workflow_type.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned.
Sourcepub fn place_workflow(
&self,
workflow_type: impl Into<String>,
workflow_pid: Pid,
) -> Result<TypeSupervisorId, EngineError>
pub fn place_workflow( &self, workflow_type: impl Into<String>, workflow_pid: Pid, ) -> Result<TypeSupervisorId, EngineError>
Place a workflow process under its per-type supervisor.
This creates the per-type supervisor on first use and never creates a supervisor per workflow execution.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned.
Sourcepub fn record_activity_child(
&self,
workflow_pid: Pid,
activity_pid: Pid,
) -> Result<(), EngineError>
pub fn record_activity_child( &self, workflow_pid: Pid, activity_pid: Pid, ) -> Result<(), EngineError>
Record an already-spawned linked activity child under its workflow process.
Call this only after crate::RuntimeHandle::spawn_activity succeeds;
that runtime call is the authoritative BEAM link establishment.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned, or
EngineError::Runtime when workflow_pid is not present in the tree.
Sourcepub fn type_supervisor_count(&self) -> Result<usize, EngineError>
pub fn type_supervisor_count(&self) -> Result<usize, EngineError>
Number of per-workflow-type supervisors under the engine root.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned.
Sourcepub fn type_supervisors(&self) -> Result<Vec<TypeSupervisorNode>, EngineError>
pub fn type_supervisors(&self) -> Result<Vec<TypeSupervisorNode>, EngineError>
Snapshot all per-type supervisors without holding the tree lock.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned.
Sourcepub fn workflow(
&self,
workflow_pid: Pid,
) -> Result<Option<WorkflowNode>, EngineError>
pub fn workflow( &self, workflow_pid: Pid, ) -> Result<Option<WorkflowNode>, EngineError>
Snapshot a workflow node by PID.
§Errors
Returns EngineError::RegistryPoisoned if the tree lock was poisoned.