pub struct ClosedSqlxBroker { /* private fields */ }Expand description
The broker after shutdown: what it did to the advisory locks its deliveries held.
A broker without advisory subscriptions reports none of either.
§Examples
use ruststream::{Broker, ConnectedBroker};
use ruststream_sqlx::{ClosedSqlxBroker, SqlxBroker};
let closed: ClosedSqlxBroker = SqlxBroker::new(pool).connect().await?.shutdown().await?;
tracing::info!(
locks_released = closed.locks_released(),
connections_closed = closed.connections_closed(),
"inbox closed",
);Implementations§
Source§impl ClosedSqlxBroker
impl ClosedSqlxBroker
Sourcepub const fn locks_released(&self) -> usize
pub const fn locks_released(&self) -> usize
Locks shutdown released with Unlock (or freed from the process registry), whose sessions
went back to the pool.
§Examples
use ruststream::{Broker, ConnectedBroker};
use ruststream_sqlx::SqlxBroker;
let closed = SqlxBroker::new(pool).connect().await?.shutdown().await?;
if closed.locks_released() > 0 {
tracing::info!(
released = closed.locks_released(),
"deliveries in work went back to their queues",
);
}Sourcepub const fn connections_closed(&self) -> usize
pub const fn connections_closed(&self) -> usize
Sessions that held a lock and were closed instead: where shutdown’s release failed, and
where a delivery dropped unsettled, or a claim dropped midway, left its session closing when
shutdown began.
§Examples
use ruststream::{Broker, ConnectedBroker};
use ruststream_sqlx::SqlxBroker;
let closed = SqlxBroker::new(pool).connect().await?.shutdown().await?;
if closed.connections_closed() > 0 {
tracing::warn!(
closed = closed.connections_closed(),
"sessions holding a lock were closed rather than released",
);
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClosedSqlxBroker
impl RefUnwindSafe for ClosedSqlxBroker
impl Send for ClosedSqlxBroker
impl Sync for ClosedSqlxBroker
impl Unpin for ClosedSqlxBroker
impl UnsafeUnpin for ClosedSqlxBroker
impl UnwindSafe for ClosedSqlxBroker
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
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more