pub struct ProcMeshRef { /* private fields */ }Expand description
A reference to a ProcMesh, consisting of a set of ranked ProcRefs,
arranged into a region. ProcMeshes are named, uniquely identifying the
ProcMesh from which the reference was derived.
ProcMeshes can be sliced to create new ProcMeshes with a subset of the original ranks.
Implementations§
Source§impl ProcMeshRef
impl ProcMeshRef
Sourcepub fn new_singleton(id: ProcMeshId, proc_ref: ProcRef) -> Self
pub fn new_singleton(id: ProcMeshId, proc_ref: ProcRef) -> Self
Create a singleton ProcMeshRef, given the provided ProcRef and id.
This is used to support creating local singleton proc meshes to support this_proc()
in python client actors.
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§
Source§impl Clone for ProcMeshRef
impl Clone for ProcMeshRef
Source§fn clone(&self) -> ProcMeshRef
fn clone(&self) -> ProcMeshRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Controlled for ProcMeshRef
Controlled implementation for a proc mesh.
impl Controlled for ProcMeshRef
Controlled implementation for a proc mesh.
Source§type StateInner = ProcState
type StateInner = ProcState
resource::State<Self::StateInner>.Source§fn stall_counter() -> &'static Counter<u64>
fn stall_counter() -> &'static Counter<u64>
Source§fn id(&self) -> &ResourceId
fn id(&self) -> &ResourceId
Source§fn subscribe_to_stream(
&self,
cx: &impl Actor,
subscriber: PortRef<State<Self::StateInner>>,
) -> Result<()>
fn subscribe_to_stream( &self, cx: &impl Actor, subscriber: PortRef<State<Self::StateInner>>, ) -> Result<()>
StreamState<StateInner> updates from
the underlying agents.Source§fn forward_wait_rank_status(
&self,
cx: &impl Actor,
msg: WaitRankStatus,
) -> Result<()>
fn forward_wait_rank_status( &self, cx: &impl Actor, msg: WaitRankStatus, ) -> Result<()>
WaitRankStatus message to the underlying agents.Source§fn poll_states<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
supervision_display_name: &'life2 str,
health_state: &'life3 mut HealthState,
) -> Pin<Box<dyn Future<Output = PollResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn poll_states<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
supervision_display_name: &'life2 str,
health_state: &'life3 mut HealthState,
) -> Pin<Box<dyn Future<Output = PollResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
health_state happen
in-place. supervision_display_name is used for synthesised
supervision events (e.g., when a proc dies).Source§fn process_state(
&self,
cx: &impl Actor,
state: State<Self::StateInner>,
health_state: &mut HealthState,
) -> bool
fn process_state( &self, cx: &impl Actor, state: State<Self::StateInner>, health_state: &mut HealthState, ) -> bool
true if a
notification was emitted (used to suppress heartbeats).Source§fn handle_stop_request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
_supervision_display_name: &'life2 str,
reason: String,
health_state: &'life3 mut HealthState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn handle_stop_request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
_supervision_display_name: &'life2 str,
reason: String,
health_state: &'life3 mut HealthState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
health_state and notify
subscribers. The caller has already taken the monitor and logged.Source§fn cleanup_stop<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
reason: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cleanup_stop<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
reason: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop was not received
but the actor is shutting down).Source§impl Debug for ProcMeshRef
impl Debug for ProcMeshRef
Source§impl<'de> Deserialize<'de> for ProcMeshRef
impl<'de> Deserialize<'de> for ProcMeshRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ProcMeshRef
impl Display for ProcMeshRef
Source§impl Hash for ProcMeshRef
impl Hash for ProcMeshRef
Source§impl Named for ProcMeshRef
impl Named for ProcMeshRef
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
Source§impl PartialEq for ProcMeshRef
impl PartialEq for ProcMeshRef
Source§impl Ranked for ProcMeshRef
impl Ranked for ProcMeshRef
Source§impl RankedSliceable for ProcMeshRef
impl RankedSliceable for ProcMeshRef
Source§impl Serialize for ProcMeshRef
impl Serialize for ProcMeshRef
impl Eq for ProcMeshRef
impl StructuralPartialEq for ProcMeshRef
Auto Trait Implementations§
impl Freeze for ProcMeshRef
impl RefUnwindSafe for ProcMeshRef
impl Send for ProcMeshRef
impl Sync for ProcMeshRef
impl Unpin for ProcMeshRef
impl UnsafeUnpin for ProcMeshRef
impl UnwindSafe for ProcMeshRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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].Source§impl<T> MapIntoExt for Twhere
T: Ranked,
impl<T> MapIntoExt for Twhere
T: Ranked,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> QuoteExt for Twhere
T: ?Sized,
impl<T> QuoteExt for Twhere
T: ?Sized,
fn push_quoted<'q, Q, S>(&mut self, _q: Q, s: S)where
Q: QuoteInto<T>,
S: Into<Quotable<'q>>,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
Source§impl<T> View for T
impl<T> View for T
Source§impl<T> ViewExt for Twhere
T: View,
impl<T> ViewExt for Twhere
T: View,
Source§fn range<R>(&self, dim: &str, range: R) -> Result<<T as View>::View, ViewError>
fn range<R>(&self, dim: &str, range: R) -> Result<<T as View>::View, ViewError>
Source§fn group_by(
&self,
dim: &str,
) -> Result<impl Iterator<Item = <T as View>::View>, ViewError>
fn group_by( &self, dim: &str, ) -> Result<impl Iterator<Item = <T as View>::View>, ViewError>
dim. The returned iterator enumerates all groups
as views in the extent of dim to the last dimension of the view. Read more