pub struct Notifiers(/* private fields */);Expand description
The profile name -> dispatcher map, as a handle that survives a
configuration reload.
The map itself is rebuilt whole on every generation, but two of its readers
outlive a generation: a signer backend captures it at construction (and
signer backends are carried across reloads rather than rebuilt), and
NotifyJob captures it at registration. Handing those two a plain Arc
pinned them to generation zero, which is worse than stale — a request served
by a new router writes a notify_deliver row naming a slot id from the
new configuration, and a NotifyJob still holding the old map would answer
JobOutcome::Failed for it. Permanently:
an unknown backend id is retired rather than retried, by design.
tokio::sync::watch::Receiver::borrow takes &self and does not mark the
value seen, so this stays Clone + Send + Sync and get is
callable from any task. A generation is published with a single synchronous
tokio::sync::watch::Sender::send_replace, so no reader can observe a
half-built map.
Implementations§
Trait Implementations§
Source§impl From<Arc<HashMap<String, Arc<NotifyDispatcher>>>> for Notifiers
A fixed map, for every caller that has no reload to serve — the tests, and
any construction that predates the first generation being published.
impl From<Arc<HashMap<String, Arc<NotifyDispatcher>>>> for Notifiers
A fixed map, for every caller that has no reload to serve — the tests, and any construction that predates the first generation being published.
Dropping the sender leaves borrow working for ever (only changed() ever
errors on a closed channel), so this is a genuine constant, not a channel
that will go quiet. It is also what lets every existing call site pass an
Arc<HashMap<..>> unchanged.
Source§fn from(map: Arc<DispatcherMap>) -> Self
fn from(map: Arc<DispatcherMap>) -> Self
Auto Trait Implementations§
impl Freeze for Notifiers
impl RefUnwindSafe for Notifiers
impl Send for Notifiers
impl Sync for Notifiers
impl Unpin for Notifiers
impl UnsafeUnpin for Notifiers
impl UnwindSafe for Notifiers
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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