pub struct ChannelSupervisor { /* private fields */ }Expand description
Supervises channel actor processes on a shared beamr scheduler.
Implementations§
Source§impl ChannelSupervisor
impl ChannelSupervisor
Sourcepub fn new() -> Result<Self, LiminalError>
pub fn new() -> Result<Self, LiminalError>
Builds a supervisor with its own scheduler and the default restart policy.
§Errors
Returns LiminalError::ConversationFailed when the scheduler cannot start.
Sourcepub fn with_policy(policy: ChannelRestartPolicy) -> Result<Self, LiminalError>
pub fn with_policy(policy: ChannelRestartPolicy) -> Result<Self, LiminalError>
Builds a supervisor with an explicit restart policy on a non-clustered scheduler.
§Errors
Returns LiminalError::ConversationFailed when the scheduler cannot start.
Sourcepub fn with_distribution(
node_name: String,
creation: u32,
cookie: String,
resolver: Resolver,
policy: ChannelRestartPolicy,
) -> Result<Self, LiminalError>
pub fn with_distribution( node_name: String, creation: u32, cookie: String, resolver: Resolver, policy: ChannelRestartPolicy, ) -> Result<Self, LiminalError>
Builds a supervisor whose scheduler is distribution-enabled (SRV-005), so every channel actor and every subscriber process this supervisor spawns shares ONE clustered scheduler. This is the scheduler the cluster attaches its process-group transport to: a subscriber pid joined to a channel’s pg group MUST live on the same scheduler that owns the distribution connections, or cross-node delivery cannot reach it.
node_name/creation form this node’s distribution identity; cookie
and resolver are handed verbatim to the scheduler’s
DistributionConfig (the resolver MUST be the same instance the cluster
uses to dial seeds, so handshake-established names resolve consistently).
§Errors
Returns LiminalError::ConversationFailed when the scheduler cannot start.
Sourcepub fn scheduler(&self) -> Arc<Scheduler> ⓘ
pub fn scheduler(&self) -> Arc<Scheduler> ⓘ
The scheduler channel actors and their subscribers run on.
Sourcepub fn install_observer(&self, observer: Arc<dyn ClusterObserver>)
pub fn install_observer(&self, observer: Arc<dyn ClusterObserver>)
Installs the cluster observer (SRV-005). Idempotent: the first install wins and later attempts are ignored, so the observer can be wired exactly once after the supervisor (and its scheduler) exist.
Sourcepub fn policy(&self) -> &ChannelRestartPolicy
pub fn policy(&self) -> &ChannelRestartPolicy
The configured restart policy.
Trait Implementations§
Source§impl Clone for ChannelSupervisor
impl Clone for ChannelSupervisor
Source§fn clone(&self) -> ChannelSupervisor
fn clone(&self) -> ChannelSupervisor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more