Struct mz_timely_util::operators_async_ext::Scheduler
source · [−]Expand description
A helper type to integrate timely notifications with async futures. Its intended to be used
with a top level while loop. Timely will automatically make the futures returned by
scheduler.notified.await()
resolve when there are progress or data updates to be processed by
the operator
ⓘ
async fn example(s: Scheduler) {
while scheduler.notified().await {
}
}
Fields
inner: Rc<Cell<bool>>
Implementations
sourceimpl Scheduler
impl Scheduler
sourcefn notify(&self) -> bool
fn notify(&self) -> bool
Notifies a waiting task, returning a boolean indicating whether or not there was a pending notification already stored in the scheduler.
If a task is currently waiting, that task is notified. Otherwise, a permit is stored in
this Scheduler
and the next call to notified().await
will complete immediately
consuming the permit made available by this call to notify()
.
sourcefn is_notified(&self) -> bool
fn is_notified(&self) -> bool
Returns a boolean indicating whether a notification is pending
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Scheduler
impl !Send for Scheduler
impl !Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request