[][src]Trait pharos::Observable

pub trait Observable<Event> where
    Event: Clone + 'static + Send
{ fn observe(&mut self, queue_size: usize) -> Receiver<Event>; }

Indicate that a type is observable. You can call observe to get a stream of events.

Required methods

fn observe(&mut self, queue_size: usize) -> Receiver<Event>

Add an observer to the observable. This will use a bounded channel of the size of queue_size. Note that the use of a bounded channel provides backpressure and can slow down the observed task.

Loading content...

Implementors

Loading content...