pub enum Advance<A> {
Next(A),
Park {
state: A,
wake_after: Option<Duration>,
error: Option<AdvanceError>,
},
Done,
Failed(Error),
}Expand description
Outcome of one WalletAction::advance call.
The executor uses these to decide whether to persist, loop, schedule a wake-up or remove the checkpoint.
Variants§
Next(A)
Transition to a new state. Executor persists state and calls
advance on it.
Park
Pause until something external (notification, periodic sync) or
wake_after (when set) re-drives the action. Executor persists
state and returns.
wake_after is a hint, not a guarantee: it lives only in this
process and is lost across restarts. advance MUST tolerate
being called before the hint has elapsed.
error is the error that caused the park, if any.
Done
Terminal: executor removes the checkpoint row. Any permanent fact
the action wants to retain (e.g. an “invoice paid” record) must
be written to its own table before returning Done.
Failed(Error)
Terminal: executor removes the checkpoint row because of a fatal error. This advance should only be returned when no server change occured yet or when process has checked server status is expected one and it is safe to remove checkpoint
Auto Trait Implementations§
impl<A> !RefUnwindSafe for Advance<A>
impl<A> !UnwindSafe for Advance<A>
impl<A> Freeze for Advance<A>where
A: Freeze,
impl<A> Send for Advance<A>where
A: Send,
impl<A> Sync for Advance<A>where
A: Sync,
impl<A> Unpin for Advance<A>where
A: Unpin,
impl<A> UnsafeUnpin for Advance<A>where
A: UnsafeUnpin,
Blanket Implementations§
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request