[−][src]Struct riker::system::ActorSystem
The actor runtime and common services coordinator
The ActorSystem
provides a runtime on which actors are executed.
It also provides common services such as channels, persistence
and scheduling. The ActorSystem
is the heart of a Riker application,
starting serveral threads when it is created. Create only one instance
of ActorSystem
per application.
Fields
exec: ThreadPool
timer: Sender<Job>
sys_channels: Option<SysChannels>
Methods
impl ActorSystem
[src]
pub fn new() -> Result<ActorSystem, SystemError>
[src]
Create a new ActorSystem
instance
Requires a type that implements the Model
trait.
pub fn with_name(name: &str) -> Result<ActorSystem, SystemError>
[src]
Create a new ActorSystem
instance with provided name
Requires a type that implements the Model
trait.
pub fn with_config(name: &str, cfg: Config) -> Result<ActorSystem, SystemError>
[src]
Create a new ActorSystem
instance bypassing default config behavior
pub fn start_date(&self) -> &DateTime<Utc>
[src]
Returns the system start date
pub fn uptime(&self) -> u64
[src]
Returns the number of seconds since the system started
pub fn host(&self) -> Arc<String>
[src]
Returns the hostname used when the system started
The host is used in actor addressing.
Currently not used, but will be once system clustering is introduced.
pub fn id(&self) -> Uuid
[src]
Returns the UUID assigned to the system
pub fn name(&self) -> String
[src]
Returns the name of the system
pub fn print_tree(&self)
[src]
pub fn user_root(&self) -> &BasicActorRef
[src]
Returns the user root actor reference
pub fn sys_root(&self) -> &BasicActorRef
[src]
Returns the system root actor reference
pub fn temp_root(&self) -> &BasicActorRef
[src]
Reutrns the temp root actor reference
pub fn sys_events(&self) -> &ActorRef<ChannelMsg<SystemEvent>>
[src]
Returns a reference to the system events channel
pub fn dead_letters(&self) -> &ActorRef<DLChannelMsg>
[src]
Returns a reference to the dead letters channel
pub fn publish_event(&self, evt: SystemEvent)
[src]
pub fn config(&self) -> Config
[src]
Returns the Config
used by the system
pub fn sys_actor_of<A>(
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
[src]
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
Create an actor under the system root
pub fn shutdown(&self) -> Receiver<()>
[src]
Shutdown the actor system
Attempts a graceful shutdown of the system and all actors.
Actors will receive a stop message, executing actor.post_stop
.
Does not block. Returns a future which is completed when all actors have successfully stopped.
Trait Implementations
impl ActorRefFactory for ActorSystem
[src]
fn actor_of<A>(
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
[src]
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
fn stop(&self, actor: impl ActorReference)
[src]
impl<'_> ActorRefFactory for &'_ ActorSystem
[src]
fn actor_of<A>(
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
[src]
&self,
props: BoxActorProd<A>,
name: &str
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
fn stop(&self, actor: impl ActorReference)
[src]
impl TmpActorRefFactory for ActorSystem
[src]
fn tmp_actor_of<A>(
&self,
props: BoxActorProd<A>
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
[src]
&self,
props: BoxActorProd<A>
) -> Result<ActorRef<A::Msg>, CreateError> where
A: Actor,
impl ActorSelectionFactory for ActorSystem
[src]
fn select(&self, path: &str) -> Result<ActorSelection, InvalidPath>
[src]
impl Run for ActorSystem
[src]
fn run<Fut>(
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: Future + Send + 'static,
<Fut as Future>::Output: Send,
[src]
&self,
future: Fut
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError> where
Fut: Future + Send + 'static,
<Fut as Future>::Output: Send,
impl Timer for ActorSystem
[src]
fn schedule<T, M>(
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn schedule_once<T, M>(
&self,
delay: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
delay: Duration,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn schedule_at_time<T, M>(
&self,
time: DateTime<Utc>,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
[src]
&self,
time: DateTime<Utc>,
receiver: ActorRef<M>,
sender: Sender,
msg: T
) -> Uuid where
T: Message + Into<M>,
M: Message,
fn cancel_schedule(&self, id: Uuid)
[src]
impl Clone for ActorSystem
[src]
fn clone(&self) -> ActorSystem
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Sync for ActorSystem
[src]
impl Send for ActorSystem
[src]
impl Debug for ActorSystem
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Message for T where
T: 'static + Send + Clone + Debug,
[src]
T: 'static + Send + Clone + Debug,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,