pub struct History { /* private fields */ }
Expand description
The history of invocations sent by the client to be executed on the workers. This is used to track dependencies between invocations and to propagate exceptions. It purges history for completed invocations to avoid memory bloat. TODO: Revisit this setup around purging refs automatically once we start doing more complex data dependency tracking. We will want to be more aware of things like borrows, drops etc. directly.
Implementations§
Source§impl History
impl History
pub fn new(world_size: usize) -> Self
pub fn first_incomplete_seqs_controller(&self) -> &[Seq]
pub fn min_incomplete_seq_reported(&self) -> Seq
pub fn world_size(&self) -> usize
pub fn delete_invocations_for_refs(&mut self, refs: Vec<Ref>)
Sourcepub fn add_invocation(
&mut self,
seq: Seq,
uses: Vec<Ref>,
defs: Vec<Ref>,
) -> Vec<(Seq, Option<Result<Serialized, Exception>>)>
pub fn add_invocation( &mut self, seq: Seq, uses: Vec<Ref>, defs: Vec<Ref>, ) -> Vec<(Seq, Option<Result<Serialized, Exception>>)>
Add an invocation to the history.
Sourcepub fn propagate_exception(&mut self, seq: Seq, exception: Exception)
pub fn propagate_exception(&mut self, seq: Seq, exception: Exception)
Propagate worker error to the invocation with the given Seq. This will also propagate to all seqs that depend on this seq directly or indirectly.
pub fn report_deadline_missed(&mut self)
pub fn deadline( &mut self, expected_progress: u64, timeout: Duration, clock: &impl Clock, ) -> Option<(Seq, Instant, bool)>
pub fn update_deadline_tracking(&mut self, rank: usize, seq: Seq)
Sourcepub fn rank_completed(
&mut self,
rank: usize,
seq: Seq,
) -> Vec<(Seq, Option<Result<Serialized, Exception>>)>
pub fn rank_completed( &mut self, rank: usize, seq: Seq, ) -> Vec<(Seq, Option<Result<Serialized, Exception>>)>
Mark the given rank as completed up to but excluding the given Seq. This will also purge history for any Seqs that are no longer relevant (completed on all ranks).
pub fn set_result(&mut self, seq: Seq, result: Result<Serialized, WorkerError>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for History
impl RefUnwindSafe for History
impl Send for History
impl Sync for History
impl Unpin for History
impl UnwindSafe for History
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§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