pub struct ProcAgent { /* private fields */ }Expand description
A mesh agent is responsible for managing procs in a [ProcMesh].
§Supervision event ingestion (remote)
ProcAgent is the process/rank-local sink for
ActorSupervisionEvents produced by the runtime (actor failures,
routing failures, undeliverables, etc.).
We export ActorSupervisionEvent as a handler so that other
procs—most importantly the process-global root client created by
context()—can forward undeliverables as supervision
events to the currently active mesh.
Without exporting this handler, ActorSupervisionEvent cannot be
addressed via ActorRef/PortRef across processes, and the
global-root-client undeliverable → supervision pipeline would
degrade to log-only behavior (events become undeliverable again or
are dropped).
See GC-1 in global_context module doc.
Trait Implementations§
Source§impl Actor for ProcAgent
impl Actor for ProcAgent
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn cleanup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_err: Option<&'life2 ActorError>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn cleanup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_err: Option<&'life2 ActorError>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn spawn(self, cx: &impl Actor) -> Result<ActorHandle<Self>, Error>
fn spawn(self, cx: &impl Actor) -> Result<ActorHandle<Self>, Error>
Instance).
The spawned actor will be supervised by the parent (spawning) actor.Source§fn spawn_with_name(
self,
cx: &impl Actor,
name: &str,
) -> Result<ActorHandle<Self>, Error>
fn spawn_with_name( self, cx: &impl Actor, name: &str, ) -> Result<ActorHandle<Self>, Error>
spawn, but the child gets name in its ActorId.Source§fn spawn_detached(self) -> Result<ActorHandle<Self>, Error>
fn spawn_detached(self) -> Result<ActorHandle<Self>, Error>
Source§fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
Source§fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
envelope: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
envelope: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn display_name(&self) -> Option<String>
fn display_name(&self) -> Option<String>
Source§impl Handler<ActorSupervisionEvent> for ProcAgent
impl Handler<ActorSupervisionEvent> for ProcAgent
Source§impl Handler<CreateOrUpdate<ActorSpec>> for ProcAgent
impl Handler<CreateOrUpdate<ActorSpec>> for ProcAgent
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
create_or_update: CreateOrUpdate<ActorSpec>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
create_or_update: CreateOrUpdate<ActorSpec>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Handler<GetRankStatus> for ProcAgent
impl Handler<GetRankStatus> for ProcAgent
Source§impl Handler<KeepaliveGetState<ActorState>> for ProcAgent
impl Handler<KeepaliveGetState<ActorState>> for ProcAgent
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
message: KeepaliveGetState<ActorState>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
message: KeepaliveGetState<ActorState>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Handler<NewClientInstance> for ProcAgent
impl Handler<NewClientInstance> for ProcAgent
Source§impl Handler<StopAll> for ProcAgent
Handles StopAll by coordinating an orderly stop of child actors and then
exiting the process. This handler never returns to the caller: it calls
std::process::exit(0/1) after shutdown. Any sender must not expect a
reply or send any further message, and should watch ProcStatus instead.
impl Handler<StopAll> for ProcAgent
Handles StopAll by coordinating an orderly stop of child actors and then
exiting the process. This handler never returns to the caller: it calls
std::process::exit(0/1) after shutdown. Any sender must not expect a
reply or send any further message, and should watch ProcStatus instead.
Source§impl MeshAgentMessageHandler for ProcAgent
impl MeshAgentMessageHandler for ProcAgent
Source§fn configure<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
rank: usize,
forwarder: ChannelAddr,
supervisor: Option<PortRef<ActorSupervisionEvent>>,
address_book: HashMap<ProcId, ChannelAddr>,
configured: PortRef<usize>,
record_supervision_events: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn configure<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
rank: usize,
forwarder: ChannelAddr,
supervisor: Option<PortRef<ActorSupervisionEvent>>,
address_book: HashMap<ProcId, ChannelAddr>,
configured: PortRef<usize>,
record_supervision_events: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn gspawn<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_type: String,
actor_name: String,
params_data: Data,
status_port: PortRef<GspawnResult>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn gspawn<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_type: String,
actor_name: String,
params_data: Data,
status_port: PortRef<GspawnResult>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stop_actor<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_id: ActorId,
timeout_ms: u64,
reason: String,
) -> Pin<Box<dyn Future<Output = Result<StopActorResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_actor<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
actor_id: ActorId,
timeout_ms: u64,
reason: String,
) -> Pin<Box<dyn Future<Output = Result<StopActorResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn status<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
status_port: PortRef<(usize, bool)>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
status_port: PortRef<(usize, bool)>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Named for ProcAgent
impl Named for ProcAgent
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§fn port() -> u64
fn port() -> u64
impl Accepts<ActorSupervisionEvent> for ProcAgent
impl Accepts<CreateOrUpdate<ActorSpec>> for ProcAgent
impl Accepts<GetRankStatus> for ProcAgent
impl Accepts<GetState<ActorState>> for ProcAgent
impl Accepts<IndexedErasedUnbound<CreateOrUpdate<ActorSpec>>> for ProcAgent
impl Accepts<IndexedErasedUnbound<GetRankStatus>> for ProcAgent
impl Accepts<IndexedErasedUnbound<GetState<ActorState>>> for ProcAgent
impl Accepts<IndexedErasedUnbound<KeepaliveGetState<ActorState>>> for ProcAgent
impl Accepts<IndexedErasedUnbound<RepublishIntrospect>> for ProcAgent
impl Accepts<IndexedErasedUnbound<Stop>> for ProcAgent
impl Accepts<IndexedErasedUnbound<StopAll>> for ProcAgent
impl Accepts<IntrospectMessage> for ProcAgent
impl Accepts<KeepaliveGetState<ActorState>> for ProcAgent
impl Accepts<Signal> for ProcAgent
impl Accepts<Stop> for ProcAgent
impl Accepts<StopAll> for ProcAgent
impl Referable for ProcAgent
impl RemoteHandles<ActorSupervisionEvent> for ProcAgent
impl RemoteHandles<CreateOrUpdate<ActorSpec>> for ProcAgent
impl RemoteHandles<GetRankStatus> for ProcAgent
impl RemoteHandles<GetState<ActorState>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<CreateOrUpdate<ActorSpec>>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<GetRankStatus>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<GetState<ActorState>>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<KeepaliveGetState<ActorState>>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<RepublishIntrospect>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<Stop>> for ProcAgent
impl RemoteHandles<IndexedErasedUnbound<StopAll>> for ProcAgent
impl RemoteHandles<IntrospectMessage> for ProcAgent
impl RemoteHandles<KeepaliveGetState<ActorState>> for ProcAgent
impl RemoteHandles<Signal> for ProcAgent
impl RemoteHandles<Stop> for ProcAgent
impl RemoteHandles<StopAll> for ProcAgent
Auto Trait Implementations§
impl !Freeze for ProcAgent
impl !RefUnwindSafe for ProcAgent
impl Send for ProcAgent
impl Sync for ProcAgent
impl Unpin for ProcAgent
impl !UnwindSafe for ProcAgent
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
Source§impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].