pub struct OperatorPoll {
handle: JoinHandle<()>,
stop: Arc<Notify>,
}Expand description
A running operator poll, stopped by OperatorPoll::stop or by
dropping it.
Fields§
§handle: JoinHandle<()>§stop: Arc<Notify>Implementations§
Source§impl OperatorPoll
impl OperatorPoll
Sourcepub fn spawn(
relation: Arc<OperatorRelation>,
estop: Arc<Estop>,
lifecycle: Arc<ServerLifecycle>,
registry: Arc<dyn Registry>,
client: Client,
private: PrivateAddresses,
schedule: PollSchedule,
nudge: Arc<PollNudge>,
policies: Option<Arc<PolicyPoll>>,
records_read: Arc<OperatorRecords>,
operator_handle: Option<Arc<OperatorHandle>>,
) -> Self
pub fn spawn( relation: Arc<OperatorRelation>, estop: Arc<Estop>, lifecycle: Arc<ServerLifecycle>, registry: Arc<dyn Registry>, client: Client, private: PrivateAddresses, schedule: PollSchedule, nudge: Arc<PollNudge>, policies: Option<Arc<PolicyPoll>>, records_read: Arc<OperatorRecords>, operator_handle: Option<Arc<OperatorHandle>>, ) -> Self
Starts polling relation against the real network on schedule,
driving estop’s self latch from what it finds, admitting the
reservations registry holds that the operator has vouched for, and
reporting to lifecycle whether a claim currently stands. Each tick
that reads the operator’s DID document also starts a check of the
handle it claims, into operator_handle, which the tick does not
wait for.
The first tick fires immediately, not after one interval: a server that waited a full interval before its first chance to find an already-existing claim would refuse writes for no reason a fresh restart should ever cause.
nudge lets a caller ask for a poll sooner than the schedule’s
interval, bounded by its floor. A nudge arriving less than the floor
since the last poll waits out the remainder rather than polling, and
every further nudge inside that window coalesces into the same single
poll. So an unbounded burst of nudges costs this server one extra
outbound request, not one per nudge — see PollNudge.
Auto Trait Implementations§
impl Freeze for OperatorPoll
impl RefUnwindSafe for OperatorPoll
impl Send for OperatorPoll
impl Sync for OperatorPoll
impl Unpin for OperatorPoll
impl UnsafeUnpin for OperatorPoll
impl UnwindSafe for OperatorPoll
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