pub struct ActorSystem { /* private fields */ }Expand description
Public handle to the actor system.
Implementations§
Source§impl ActorSystem
impl ActorSystem
Sourcepub async fn create(
name: impl Into<String>,
config: Config,
) -> Result<Self, ActorSystemError>
pub async fn create( name: impl Into<String>, config: Config, ) -> Result<Self, ActorSystemError>
Create an actor system with the given name and configuration.
pub fn name(&self) -> &str
pub fn address(&self) -> &Address
pub fn config(&self) -> &Config
pub fn scheduler(&self) -> Arc<dyn Scheduler> ⓘ
pub fn extensions(&self) -> &Extensions
Sourcepub fn set_spawn_observer(&self, obs: Arc<dyn SpawnObserver>)
pub fn set_spawn_observer(&self, obs: Arc<dyn SpawnObserver>)
Install a SpawnObserver. Only one observer may be installed;
subsequent calls replace the previous one. This is the hook used by
atomr-telemetry to populate its actor registry.
Sourcepub fn set_dead_letter_observer(&self, obs: Arc<dyn DeadLetterObserver>)
pub fn set_dead_letter_observer(&self, obs: Arc<dyn DeadLetterObserver>)
Install a DeadLetterObserver that is notified when a tell
fails because the target has stopped.
Sourcepub fn set_remote_provider(&self, provider: Arc<dyn RemoteProvider>)
pub fn set_remote_provider(&self, provider: Arc<dyn RemoteProvider>)
Install the remote provider. Done by atomr-remote::RemoteSystemExt::enable_remote.
Replaces any previous provider.
Sourcepub fn is_remote_path(&self, path: &ActorPath) -> bool
pub fn is_remote_path(&self, path: &ActorPath) -> bool
True if a remote provider is installed and the address has global scope.
Sourcepub fn actor_selection(&self, path_str: &str) -> Option<UntypedActorRef>
pub fn actor_selection(&self, path_str: &str) -> Option<UntypedActorRef>
Look up an actor by full path string. Local paths return the local child if it exists; remote paths consult the installed remote provider.
Sourcepub fn actor_selection_with<M>(
&self,
path_str: &str,
serialize: Arc<dyn Fn(M, Option<ActorPath>) -> SerializedMessage + Send + Sync>,
) -> Option<ActorRef<M>>where
M: Send + 'static,
pub fn actor_selection_with<M>(
&self,
path_str: &str,
serialize: Arc<dyn Fn(M, Option<ActorPath>) -> SerializedMessage + Send + Sync>,
) -> Option<ActorRef<M>>where
M: Send + 'static,
Resolve a remote path and produce a typed ActorRef<M>. The caller
supplies a serializer closure for M; atomr-remote::RemoteSystem
provides a default that uses bincode + type_name::<M>().
Sourcepub fn actor_of<A: Actor>(
&self,
props: Props<A>,
name: &str,
) -> Result<ActorRef<A::Msg>, ActorSystemError>
pub fn actor_of<A: Actor>( &self, props: Props<A>, name: &str, ) -> Result<ActorRef<A::Msg>, ActorSystemError>
Spawn a top-level actor under /user.
pub async fn when_terminated(&self)
Trait Implementations§
Source§impl Clone for ActorSystem
impl Clone for ActorSystem
Source§fn clone(&self) -> ActorSystem
fn clone(&self) -> ActorSystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more