pub struct SystemActor { /* private fields */ }
Expand description
The system actor manages the whole system. It is responsible for managing the systems’ worlds, and for managing their constituent procs. The system actor also provides a central mailbox that can route messages to any live actor in the system.
Implementations§
Source§impl SystemActor
impl SystemActor
Sourcepub async fn bootstrap(
params: SystemActorParams,
) -> Result<(ActorHandle<SystemActor>, Proc), Error>
pub async fn bootstrap( params: SystemActorParams, ) -> Result<(ActorHandle<SystemActor>, Proc), Error>
Bootstrap the system actor. This will create a proc, spawn the actor on that proc, and then return the actor handle and the corresponding proc.
Sourcepub async fn bootstrap_with_clock(
params: SystemActorParams,
clock: ClockKind,
) -> Result<(ActorHandle<SystemActor>, Proc), Error>
pub async fn bootstrap_with_clock( params: SystemActorParams, clock: ClockKind, ) -> Result<(ActorHandle<SystemActor>, Proc), Error>
Bootstrap the system actor with a specified clock.This will create a proc, spawn the actor on that proc, and then return the actor handle and the corresponding proc.
Trait Implementations§
Source§impl Actor for SystemActor
impl Actor for SystemActor
Source§type Params = SystemActorParams
type Params = SystemActorParams
Source§fn new<'async_trait>(
params: SystemActorParams,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn new<'async_trait>(
params: SystemActorParams,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'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,
cx: &'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 handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
__arg2: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
__arg2: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn spawn<'life0, 'async_trait>(
cap: &'life0 (impl CanSpawn + 'async_trait),
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn spawn<'life0, 'async_trait>(
cap: &'life0 (impl CanSpawn + 'async_trait),
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Instance
).
The spawned actor will be supervised by the parent (spawning) actor.Source§fn spawn_detached<'async_trait>(
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn spawn_detached<'async_trait>(
params: Self::Params,
) -> Pin<Box<dyn Future<Output = Result<ActorHandle<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
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§impl Binds<SystemActor> for SystemActor
impl Binds<SystemActor> for SystemActor
Source§impl Clone for SystemActor
impl Clone for SystemActor
Source§fn clone(&self) -> SystemActor
fn clone(&self) -> SystemActor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SystemActor
impl Debug for SystemActor
Source§impl Handler<ProcStopResult> for SystemActor
impl Handler<ProcStopResult> for SystemActor
Source§impl Handler<ProcSupervisionMessage> for SystemActor
impl Handler<ProcSupervisionMessage> for SystemActor
Source§impl Handler<SystemMessage> for SystemActor
impl Handler<SystemMessage> for SystemActor
Source§impl Handler<WorldSupervisionMessage> for SystemActor
impl Handler<WorldSupervisionMessage> for SystemActor
Source§impl Named for SystemActor
impl Named for SystemActor
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 SystemMessageHandler for SystemActor
+——+ spawns +––+ joins +—–+
| Proc |<–––––|Host|———>|World|
+——+ +––+ +—–+
| ^
| joins |
+———————————–+
When bootstrapping the system,
impl SystemMessageHandler for SystemActor
+——+ spawns +––+ joins +—–+ | Proc |<–––––|Host|———>|World| +——+ +––+ +—–+ | ^ | joins | +———————————–+ When bootstrapping the system,
- hosts will join the world,
- hosts will spawn (worker) procs,
- procs will join the world
Source§fn join<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
world_id: WorldId,
proc_id: ProcId,
proc_message_port: PortRef<ProcMessage>,
channel_addr: ChannelAddr,
labels: HashMap<String, String>,
lifecycle_mode: ProcLifecycleMode,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn join<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
world_id: WorldId,
proc_id: ProcId,
proc_message_port: PortRef<ProcMessage>,
channel_addr: ChannelAddr,
labels: HashMap<String, String>,
lifecycle_mode: ProcLifecycleMode,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn upsert_world<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
world_id: WorldId,
shape: Shape,
num_procs_per_host: usize,
env: Environment,
labels: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_world<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
world_id: WorldId,
shape: Shape,
num_procs_per_host: usize,
env: Environment,
labels: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn snapshot<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
filter: SystemSnapshotFilter,
) -> Pin<Box<dyn Future<Output = Result<SystemSnapshot, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn snapshot<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, Self>,
filter: SystemSnapshotFilter,
) -> Pin<Box<dyn Future<Output = Result<SystemSnapshot, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
worlds: Option<Vec<WorldId>>,
proc_timeout: Duration,
reply_port: OncePortRef<()>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
worlds: Option<Vec<WorldId>>,
proc_timeout: Duration,
reply_port: OncePortRef<()>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
impl RemoteActor for SystemActor
impl RemoteHandles<ProcSupervisionMessage> for SystemActor
impl RemoteHandles<Signal> for SystemActor
impl RemoteHandles<SystemMessage> for SystemActor
impl RemoteHandles<WorldSupervisionMessage> for SystemActor
Auto Trait Implementations§
impl Freeze for SystemActor
impl !RefUnwindSafe for SystemActor
impl Send for SystemActor
impl Sync for SystemActor
impl Unpin for SystemActor
impl !UnwindSafe for SystemActor
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
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