pub struct ActorMesh<A: Referable> { /* private fields */ }Expand description
An ActorMesh is a collection of ranked A-typed actors.
Bound note: A: Referable because the mesh stores/returns
hyperactor_reference::ActorRef<A>, which is only defined for A: Referable.
Implementations§
Methods from Deref<Target = ActorMeshRef<A>>§
Sourcepub fn cast<M>(&self, cx: &impl Actor, message: M) -> Result<()>where
A: RemoteHandles<M> + RemoteHandles<IndexedErasedUnbound<M>>,
M: Castable + RemoteMessage + Clone,
pub fn cast<M>(&self, cx: &impl Actor, message: M) -> Result<()>where
A: RemoteHandles<M> + RemoteHandles<IndexedErasedUnbound<M>>,
M: Castable + RemoteMessage + Clone,
Cast a message to all the actors in this mesh
Sourcepub fn cast_for_tensor_engine_only_do_not_use<M>(
&self,
cx: &impl Actor,
sel: Selection,
message: M,
) -> Result<()>where
A: RemoteHandles<M> + RemoteHandles<IndexedErasedUnbound<M>>,
M: Castable + RemoteMessage + Clone,
pub fn cast_for_tensor_engine_only_do_not_use<M>(
&self,
cx: &impl Actor,
sel: Selection,
message: M,
) -> Result<()>where
A: RemoteHandles<M> + RemoteHandles<IndexedErasedUnbound<M>>,
M: Castable + RemoteMessage + Clone,
Cast a message to the actors in this mesh according to the provided selection. This should only be used for temporary support for selections in the tensor engine. If you use this for anything else, you will be fired (you too, OSS contributor).
Sourcepub async fn actor_states(
&self,
cx: &impl Actor,
) -> Result<ValueMesh<State<ActorState>>>
pub async fn actor_states( &self, cx: &impl Actor, ) -> Result<ValueMesh<State<ActorState>>>
Query the state of all actors in this mesh. If keepalive is Some, use a message that indicates to the recipient that the owner of the mesh is still alive, along with the expiry time after which the actor should be considered orphaned. Else, use a normal state query.
pub fn name(&self) -> &Name
pub fn proc_mesh(&self) -> &ProcMeshRef
pub fn controller(&self) -> &Option<ActorRef<ActorMeshController<A>>>
Sourcepub async fn next_supervision_event(
&self,
cx: &impl Actor,
) -> Result<MeshFailure, Error>
pub async fn next_supervision_event( &self, cx: &impl Actor, ) -> Result<MeshFailure, Error>
Returns the next supervision event occurring on this mesh. Await this simultaneously with the return result of a message (such as awaiting a reply after a cast) to get back a message that indicates the actor that failed, instead of waiting forever for a reply. If there are multiple simultaneous awaits of next_supervision_event, all of them will receive the same event.
Sourcepub fn clone_with_supervision_receiver(&self) -> Self
pub fn clone_with_supervision_receiver(&self) -> Self
Same as Clone, but includes a shared supervision receiver. This copy will share the same health state and get the same supervision events. Will have a separate cache.
Trait Implementations§
Source§impl<A: Referable> Clone for ActorMesh<A>
Manual implementation of Clone because A doesn’t need to implement Clone
but we still want to be able to clone the ActorMesh.
impl<A: Referable> Clone for ActorMesh<A>
Manual implementation of Clone because A doesn’t need to implement Clone
but we still want to be able to clone the ActorMesh.
Auto Trait Implementations§
impl<A> !Freeze for ActorMesh<A>
impl<A> RefUnwindSafe for ActorMesh<A>
impl<A> Send for ActorMesh<A>
impl<A> Sync for ActorMesh<A>
impl<A> Unpin for ActorMesh<A>
impl<A> UnwindSafe for ActorMesh<A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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].§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>>,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.