Struct organelle::Effector
[−]
[src]
pub struct Effector<M, R> where
M: CellMessage,
R: CellRole, { /* fields omitted */ }
the effector is a cell's method of communicating between other cells
the effector can send a message to any destination, provided you have its handle. it will route these messages asynchronously to their destination, so communication can be tricky, however, this is truly the best way I've found to compose efficient, scalable systems.
Methods
impl<M, R> Effector<M, R> where
M: CellMessage,
R: CellRole,
[src]
M: CellMessage,
R: CellRole,
fn this_cell(&self) -> Handle
[src]
get the Handle associated with the cell that owns this effector
fn send(&self, dest: Handle, msg: M)
[src]
send a message to dest cell
fn send_in_order(&self, dest: Handle, msgs: Vec<M>)
[src]
send a batch of messages in order to dest cell
fn stop(&self)
[src]
stop the organelle
fn error(&self, e: Error)
[src]
stop the organelle because of an error
fn spawn<F>(&self, future: F) where
F: Future<Item = (), Error = ()> + 'static,
[src]
F: Future<Item = (), Error = ()> + 'static,
spawn a future on the reactor
fn reactor(&self) -> Handle
[src]
get a reactor handle
fn remote(&self) -> Remote
[src]
get a reactor remote
Trait Implementations
impl<M, R> Clone for Effector<M, R> where
M: CellMessage,
R: CellRole,
[src]
M: CellMessage,
R: CellRole,