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.
pub async fn proc_states( &self, cx: &impl Actor, keepalive: Option<SystemTime>, ) -> Result<Option<ValueMesh<State<ProcState>>>>
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_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<'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<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
§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].