Struct tiny_tokio_actor::ActorSystem [−][src]
pub struct ActorSystem<E: SystemEvent> { /* fields omitted */ }
Implementations
Publish an event on the actor system’s event bus. These events can be received by other actors in the same actor system.
Subscribe to events of this actor system.
Retrieves an actor running in this actor system. If actor does not exist, a None is returned instead.
pub async fn create_actor<A: Actor<E>>(
&self,
name: &str,
actor: A
) -> Result<ActorRef<E, A>, ActorError>
pub async fn create_actor<A: Actor<E>>(
&self,
name: &str,
actor: A
) -> Result<ActorRef<E, A>, ActorError>
Launches a new top level actor on this actor system at the ‘/user’ actor path. If another actor with
the same name already exists, an Err(ActorError::Exists(ActorPath))
is returned instead.
pub async fn get_or_create_actor<A, F>(
&self,
name: &str,
actor_fn: F
) -> Result<ActorRef<E, A>, ActorError> where
A: Actor<E>,
F: FnOnce() -> A,
pub async fn get_or_create_actor<A, F>(
&self,
name: &str,
actor_fn: F
) -> Result<ActorRef<E, A>, ActorError> where
A: Actor<E>,
F: FnOnce() -> A,
Retrieve or create a new actor on this actor system if it does not exist yet.
Stops the actor on this actor system. All its children will also be stopped.
Trait Implementations
Auto Trait Implementations
impl<E> !RefUnwindSafe for ActorSystem<E>
impl<E> Send for ActorSystem<E>
impl<E> Sync for ActorSystem<E>
impl<E> Unpin for ActorSystem<E>
impl<E> !UnwindSafe for ActorSystem<E>
Blanket Implementations
Mutably borrows from an owned value. Read more