pub struct ProcMesh { /* private fields */ }Expand description
A mesh of processes.
Implementations§
Source§impl ProcMesh
impl ProcMesh
Sourcepub async fn stop(&mut self, cx: &impl Actor, reason: String) -> Result<()>
pub async fn stop(&mut self, cx: &impl Actor, reason: String) -> Result<()>
Stop this mesh gracefully.
If a ProcMeshController is present (owned meshes spawned from a host
mesh), the stop is delegated to the controller via resource::Stop;
the controller’s handler awaits HostMeshRef::stop_proc_mesh, which
casts Stop + WaitRankStatus{min_status: Stopped} to the
HostAgents and waits up to PROC_STOP_MAX_IDLE for every proc to
reach Stopped. We then serialize behind that handler with a
GetState to read the final statuses out of the controller’s
health_state.
Methods from Deref<Target = ProcMeshRef>§
pub fn id(&self) -> &ProcMeshId
pub fn host_mesh_id(&self) -> Option<&HostMeshId>
Sourcepub fn hosts(&self) -> Option<&HostMeshRef>
pub fn hosts(&self) -> Option<&HostMeshRef>
Returns the HostMeshRef that owns this ProcMeshRef, if any.
Sourcepub async fn actor_states(
&self,
cx: &impl Actor,
id: ActorMeshId,
) -> Result<ValueMesh<State<ActorState>>>
pub async fn actor_states( &self, cx: &impl Actor, id: ActorMeshId, ) -> Result<ValueMesh<State<ActorState>>>
Query the state of all actors in this mesh matching the given id.
Sourcepub async fn states(
&self,
cx: &impl Actor,
keepalive: Option<SystemTime>,
) -> Result<Option<ValueMesh<State<ProcState>>>>
pub async fn states( &self, cx: &impl Actor, keepalive: Option<SystemTime>, ) -> Result<Option<ValueMesh<State<ProcState>>>>
Get the state of every proc in this proc mesh.
Casts a single GetHostProcStates to the routing host-agent mesh
carrying this mesh’s selected global ranks (the mesh may be sliced, so
they need not be a dense 0..n). The cast may reach hosts that own no
selected procs, but each HostAgent filters locally and only hosts with
matching ranks reply. Replies reduce up the cast tree (fanning in at cast
actor 0) instead of every host dialing this caller. When keepalive is
Some, each proc’s expiry is extended (orphan protection, as with
KeepaliveGetState). Returns None when this proc mesh is not backed by
a host mesh (local/in-process meshes). On timeout, ranks whose host did
not reply are padded with a Timeout state.
Sourcepub async fn spawn<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>
pub async fn spawn<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: &str, params: &A::Params, ) -> Result<ActorMesh<A>>
Spawn an actor on all of the procs in this mesh, returning a new ActorMesh.
Bounds:
A: Actor- the actor actually runs inside each proc.A: Referable- so we can return typedActorRef<A>s inside theActorMesh.A::Params: RemoteMessage- spawn parameters must be serializable and routable.
Sourcepub async fn spawn_service<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>
pub async fn spawn_service<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: &str, params: &A::Params, ) -> Result<ActorMesh<A>>
Spawn a ‘service’ actor. Service actors are singletons, using reserved names. The provided name is used verbatim as the actor’s name, and thus it may be persistently looked up by constructing the appropriate name.
Note: avoid using service actors if possible; the mechanism will be replaced by an actor registry.
Sourcepub async fn spawn_controllerless_service<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>where
A::Params: RemoteMessage,
pub async fn spawn_controllerless_service<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>where
A::Params: RemoteMessage,
Spawn a controllerless ‘service’ actor.
Like spawn_service, this spawns a singleton
service actor (a reserved name, deduped to one). Unlike spawn_service,
the resulting mesh has no ActorMeshController: no per-caller
controller actor is spawned, and the caller C is therefore not
required to implement Handler<MeshFailure>.
This is for coordinators that own their own supervision — e.g. a controllerless singleton that itself spawns controller-ful children — where a per-caller controller would be redundant.
Sourcepub async fn spawn_data<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
actor_mesh_id: ActorMeshId,
params: &A::Params,
) -> Result<ActorMesh<A>>where
A::Params: RemoteMessage,
pub async fn spawn_data<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
actor_mesh_id: ActorMeshId,
params: &A::Params,
) -> Result<ActorMesh<A>>where
A::Params: RemoteMessage,
Spawn an actor on all procs in this mesh using the new data-only mesh API.
actor_mesh_id identifies the mesh and its members, and must be an
instance id.
This initiates an actor spawn on each proc and constructs a stoppable data mesh from the actor refs and local supervisor handles without waiting for the remote supervision sessions to link. The mesh is usable immediately: each proc queues messages for its actor until the actor starts. If a request cannot be initiated, all previously created local supervisors receive a best-effort stop request.
Bounds:
A: Actor- the actor actually runs inside each proc.A: Referable- so we can return typedActorRef<A>s inside theActorMesh.A::Params: RemoteMessage- spawn parameters must be serializable and routable.
Sourcepub async fn spawn_with_name<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: ActorMeshId,
params: &A::Params,
supervision_display_name: Option<String>,
is_system_actor: bool,
) -> Result<ActorMesh<A>>
pub async fn spawn_with_name<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: ActorMeshId, params: &A::Params, supervision_display_name: Option<String>, is_system_actor: bool, ) -> Result<ActorMesh<A>>
Spawn an actor on all procs in this mesh under the given
ActorMeshId, returning a new ActorMesh.
This is the underlying implementation used by [spawn]; it
differs only in that the actor mesh id is passed explicitly
rather than as a &str.
Bounds:
A: Actor- the actor actually runs inside each proc.A: Referable- so we can return typedActorRef<A>s inside theActorMesh.A::Params: RemoteMessage- spawn parameters must be serializable and routable.C::A: Handler<MeshFailure>- in order to spawn actors, the actor must accept messages of typeMeshFailure. This is delivered when the actors spawned in the mesh have a failure that isn’t handled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcMesh
impl RefUnwindSafe for ProcMesh
impl Send for ProcMesh
impl Sync for ProcMesh
impl Unpin for ProcMesh
impl UnsafeUnpin for ProcMesh
impl UnwindSafe for ProcMesh
Blanket Implementations§
impl<T> Allocation for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
§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].