pub struct ListenerHandle { /* private fields */ }Expand description
A Listener running on a connection; see crate::Kernable::listener. Cloning gives
another handle to the same running listener.
run().await processes events until stop(). To run several listeners in one process,
spawn each (tokio::spawn(async move { handle.run().await })) and await ready() where
the next step needs them connected, or use an app (crate::Kernable::app).
Implementations§
Source§impl ListenerHandle
impl ListenerHandle
Sourcepub fn position(&self) -> u64
pub fn position(&self) -> u64
Global position of the last handled event (or skipped, for other event types).
Sourcepub fn skipped(&self) -> u64
pub fn skipped(&self) -> u64
How many events it skipped since it was made because their schema is newer than its
code reads (written by a newer deployment): a read model, live listener or replicated
instance goes on without them, the kernel counts them too. A reactor that parks
(Listener::park_after) parks such an event instead (unknown_event).
Sourcepub fn opened_store(&self) -> Option<Store>
pub fn opened_store(&self) -> Option<Store>
The listener’s store, while run() has it open.
Sourcepub async fn run(&self)
pub async fn run(&self)
Processes events, queries and checks until stop(), reconnecting when the stream drops
or a handler fails. With a store, opens it first and continues after its position; if
it cannot be opened (a full disk), logs the error and tries again, backing off like a
reconnect. When it ends, it closes the store (Store::close); a later run opens it
again.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ListenerHandle
impl !UnwindSafe for ListenerHandle
impl Forget for ListenerHandle
impl Freeze for ListenerHandle
impl Move for ListenerHandle
impl Send for ListenerHandle
impl Sync for ListenerHandle
impl Unpin for ListenerHandle
impl UnsafeUnpin for ListenerHandlewhere
*const ArcInner<HandleInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<HandleInner>>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request