Struct riker::system::ActorSystem [−][src]
pub struct ActorSystem<Msg: Message> { pub proto: Arc<ProtoSystem>, pub kernel: Option<KernelRef<Msg>>, pub event_store: Option<ActorRef<Msg>>, pub sys_channels: Option<SysChannels<Msg>>, // some fields omitted }
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
proto: Arc<ProtoSystem>
kernel: Option<KernelRef<Msg>>
event_store: Option<ActorRef<Msg>>
sys_channels: Option<SysChannels<Msg>>
Methods
impl<Msg: Message> ActorSystem<Msg>
[src]
impl<Msg: Message> ActorSystem<Msg>
pub fn new<Mdl>(model: &Mdl) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
[src]
pub fn new<Mdl>(model: &Mdl) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
Create a new ActorSystem
instance
Requires a type that implements the Model
trait.
pub fn with_name<Mdl>(
model: &Mdl,
name: &str
) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
[src]
pub fn with_name<Mdl>(
model: &Mdl,
name: &str
) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
Create a new ActorSystem
instance with provided name
Requires a type that implements the Model
trait.
pub fn with_config<Mdl>(
model: &Mdl,
name: &str,
cfg: Config
) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
[src]
pub fn with_config<Mdl>(
model: &Mdl,
name: &str,
cfg: Config
) -> Result<ActorSystem<Msg>, SystemError> where
Mdl: Model<Msg = Msg>,
Create a new ActorSystem
instance bypassing default config behavior
Requires a type that implements the Model
trait.
pub fn shutdown(&self) -> Shutdown
[src]
pub fn shutdown(&self) -> Shutdown
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.
pub fn start_date(&self) -> &DateTime<Utc>
[src]
pub fn start_date(&self) -> &DateTime<Utc>
Returns the system start date
pub fn uptime(&self) -> u64
[src]
pub fn uptime(&self) -> u64
Returns the number of seconds since the system started
pub fn host(&self) -> Arc<String>
[src]
pub fn host(&self) -> Arc<String>
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]
pub fn id(&self) -> Uuid
Returns the UUID assigned to the system
pub fn name(&self) -> String
[src]
pub fn name(&self) -> String
Returns the name of the system
pub fn print_tree(&self)
[src]
pub fn print_tree(&self)
pub fn user_root(&self) -> &ActorRef<Msg>
[src]
pub fn user_root(&self) -> &ActorRef<Msg>
Returns the user root actor reference
pub fn system_root(&self) -> &ActorRef<Msg>
[src]
pub fn system_root(&self) -> &ActorRef<Msg>
Returns the system root actor reference
pub fn temp_root(&self) -> &ActorRef<Msg>
[src]
pub fn temp_root(&self) -> &ActorRef<Msg>
Reutrns the temp root actor reference
pub fn default_stream(&self) -> &ActorRef<Msg>
[src]
pub fn default_stream(&self) -> &ActorRef<Msg>
Returns a reference to the default stream channel
pub fn event_stream(&self) -> &ActorRef<Msg>
[src]
pub fn event_stream(&self) -> &ActorRef<Msg>
Returns a reference to the event stream channel
pub fn dead_letters(&self) -> &ActorRef<Msg>
[src]
pub fn dead_letters(&self) -> &ActorRef<Msg>
Returns a reference to the dead letters channel
pub fn io_manager(&self) -> &ActorRef<Msg>
[src]
pub fn io_manager(&self) -> &ActorRef<Msg>
Returns a reference to the IO Manager
pub fn config(&self) -> Config
[src]
pub fn config(&self) -> Config
Returns the Config
used by the system
pub fn sys_actor_of(
&self,
props: BoxActorProd<Msg>,
name: &str
) -> Result<ActorRef<Msg>, CreateError>
[src]
pub fn sys_actor_of(
&self,
props: BoxActorProd<Msg>,
name: &str
) -> Result<ActorRef<Msg>, CreateError>
Create an actor under the system root
Trait Implementations
impl<Msg: Clone + Message> Clone for ActorSystem<Msg>
[src]
impl<Msg: Clone + Message> Clone for ActorSystem<Msg>
fn clone(&self) -> ActorSystem<Msg>
[src]
fn clone(&self) -> ActorSystem<Msg>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<Msg: Message> Send for ActorSystem<Msg>
[src]
impl<Msg: Message> Send for ActorSystem<Msg>
impl<Msg: Message> Sync for ActorSystem<Msg>
[src]
impl<Msg: Message> Sync for ActorSystem<Msg>
impl<Msg> ActorRefFactory for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> ActorRefFactory for ActorSystem<Msg> where
Msg: Message,
type Msg = Msg
fn actor_of(
&self,
props: BoxActorProd<Self::Msg>,
name: &str
) -> Result<ActorRef<Msg>, CreateError>
[src]
fn actor_of(
&self,
props: BoxActorProd<Self::Msg>,
name: &str
) -> Result<ActorRef<Msg>, CreateError>
fn stop(&self, actor: &ActorRef<Self::Msg>)
[src]
fn stop(&self, actor: &ActorRef<Self::Msg>)
impl<Msg> TmpActorRefFactory for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> TmpActorRefFactory for ActorSystem<Msg> where
Msg: Message,
type Msg = Msg
fn tmp_actor_of(
&self,
props: BoxActorProd<Msg>
) -> Result<ActorRef<Msg>, CreateError>
[src]
fn tmp_actor_of(
&self,
props: BoxActorProd<Msg>
) -> Result<ActorRef<Msg>, CreateError>
impl<Msg> ActorSelectionFactory for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> ActorSelectionFactory for ActorSystem<Msg> where
Msg: Message,
impl<Msg> Timer for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> Timer for ActorSystem<Msg> where
Msg: Message,
type Msg = Msg
fn schedule<T>(
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
[src]
fn schedule<T>(
&self,
initial_delay: Duration,
interval: Duration,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
fn schedule_once<T>(
&self,
delay: Duration,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
[src]
fn schedule_once<T>(
&self,
delay: Duration,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
fn schedule_at_time<T>(
&self,
time: DateTime<Utc>,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
[src]
fn schedule_at_time<T>(
&self,
time: DateTime<Utc>,
receiver: ActorRef<Self::Msg>,
sender: Option<ActorRef<Self::Msg>>,
msg: T
) -> Uuid where
T: Into<ActorMsg<Self::Msg>>,
fn cancel_schedule(&self, id: Uuid)
[src]
fn cancel_schedule(&self, id: Uuid)
impl<Msg> ExecutionContext for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> ExecutionContext for ActorSystem<Msg> where
Msg: Message,
fn execute<F: Future>(&self, f: F) -> DispatchHandle<F::Item, F::Error> where
F: Future + Send + 'static,
F::Item: Send + 'static,
F::Error: Send + 'static,
[src]
fn execute<F: Future>(&self, f: F) -> DispatchHandle<F::Item, F::Error> where
F: Future + Send + 'static,
F::Item: Send + 'static,
F::Error: Send + 'static,
impl<Msg> Debug for ActorSystem<Msg> where
Msg: Message,
[src]
impl<Msg> Debug for ActorSystem<Msg> where
Msg: Message,