pub trait Stream<Item>where
Self: Actor,{
// Required method
fn action(&mut self, msg: Item, ctx: &mut Context<Self>);
// Provided methods
fn started(&mut self, _: &mut Context<Self>) { ... }
fn state(&mut self, _: &mut Context<Self>) -> StreamingState { ... }
fn spawn_stream<S>(&mut self, ctx: &mut Context<Self>, stream: S) -> Handle
where S: Stream + 'static,
Self: Stream<S::Item> { ... }
fn aborted(&mut self, _: &mut Context<Self>) { ... }
fn paused(&mut self, _: &mut Context<Self>) { ... }
fn resumed(&mut self, _: &mut Context<Self>) { ... }
fn finished(&mut self, _: &mut Context<Self>) { ... }
}
Expand description
An abstraction for Actor’s stream routine
Required Methods§
Provided Methods§
sourcefn state(&mut self, _: &mut Context<Self>) -> StreamingState
fn state(&mut self, _: &mut Context<Self>) -> StreamingState
change the state of stream to abort/pause/resume the stream accordingly
Real-Time control or more elaborated execution could be achieved right here