pub struct ActorSystem {
pub registry: ActorRegistry,
/* private fields */
}Expand description
High-level actor system: owns the registry and drives spawning/shutdown.
Fields§
§registry: ActorRegistryImplementations§
Source§impl ActorSystem
impl ActorSystem
pub fn new() -> Self
pub fn with_publisher(publisher: EventPublisher) -> Self
pub fn publisher(&self) -> EventPublisher
Sourcepub async fn spawn_actor(&self, actor: Box<dyn Actor>) -> Result<String>
pub async fn spawn_actor(&self, actor: Box<dyn Actor>) -> Result<String>
Spawn a boxed actor, register it, and drive it on a Tokio task.
Sourcepub async fn spawn_actor_supervised(
&self,
actor: Box<dyn Actor>,
supervisor_id: Option<String>,
) -> Result<String>
pub async fn spawn_actor_supervised( &self, actor: Box<dyn Actor>, supervisor_id: Option<String>, ) -> Result<String>
Spawn a boxed actor with an optional supervisor ID tag.
Sourcepub async fn stop_actor(&self, name: &str) -> Result<()>
pub async fn stop_actor(&self, name: &str) -> Result<()>
Send a stop command to the named actor (unless it is protected).
Trait Implementations§
Source§impl Clone for ActorSystem
impl Clone for ActorSystem
Source§fn clone(&self) -> ActorSystem
fn clone(&self) -> ActorSystem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActorSystem
impl Debug for ActorSystem
Auto Trait Implementations§
impl Freeze for ActorSystem
impl !RefUnwindSafe for ActorSystem
impl Send for ActorSystem
impl Sync for ActorSystem
impl Unpin for ActorSystem
impl !UnwindSafe for ActorSystem
Blanket Implementations§
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
Mutably borrows from an owned value. Read more