pub struct PollNudge {
notify: Notify,
served: AtomicBool,
begun: AtomicU64,
finished: Sender<(u64, bool)>,
}Expand description
A request that this server look for its operator’s claim sooner than its timer would.
Urgency, never authority. Nothing here asserts a claim, carries a credential, or names an operator; the only thing a caller can influence is when this server next reads a repository it was going to read anyway, and the answer still comes from that read. A server that took anybody’s word for a claim would be a server that could be claimed by whoever asked, which is the whole reason the flip is observation-only.
Nudges coalesce: many arriving inside one MIN_POLL_INTERVAL
window set one flag and produce one poll, not one poll each. See
OperatorPoll::spawn.
Fields§
§notify: Notify§served: AtomicBoolWhether an OperatorPoll is listening, so a wait on a channel
nothing drains answers at once.
begun: AtomicU64How many polls have begun.
finished: Sender<(u64, bool)>The last poll to finish: its number, and whether it read the operator’s records.
Implementations§
Source§impl PollNudge
impl PollNudge
Sourcepub async fn nudge_and_wait(&self, within: StdDuration) -> bool
pub async fn nudge_and_wait(&self, within: StdDuration) -> bool
Nudges, then waits up to within for a poll that began after the
nudge to finish. Answers whether that poll read the operator’s
records, so a caller refused for want of an allowance can check
again against what the operator’s repository holds now.
The nudge is still bound by the floor, so a poll that ran moments
ago makes this wait out the rest of MIN_POLL_INTERVAL.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PollNudge
impl RefUnwindSafe for PollNudge
impl Send for PollNudge
impl Sync for PollNudge
impl Unpin for PollNudge
impl UnsafeUnpin for PollNudge
impl UnwindSafe for PollNudge
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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