pub struct EventLog { /* private fields */ }Expand description
The bounded event log; share it behind an Arc.
Implementations§
Source§impl EventLog
impl EventLog
Sourcepub fn push(&self, topic: &str, payload: &Value)
pub fn push(&self, topic: &str, payload: &Value)
Appends one event and wakes every waiting poll.
Sourcepub fn close(&self)
pub fn close(&self)
Ends every wait now and makes later polls answer at once (service shutdown).
Sourcepub fn poll(&self, after: u64, topics: &[String], wait: Duration) -> PollResult
pub fn poll(&self, after: u64, topics: &[String], wait: Duration) -> PollResult
The events with a number above after on one of topics (every topic when it is empty),
waiting up to wait when there are none. Never waits when the cursor is dropped, and
never busy-waits: a poll sleeps on the condition variable until an event or the deadline.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more