#[non_exhaustive]pub enum State<Task, Error> {
NotBootstrapped,
Ready,
RegisterWorker(BoxSyncFuture<Result<(), Error>>),
HeartBeat(BoxSyncFuture<Result<(), Error>>),
ProcessEvents(BoxSyncFuture<Result<(), Error>>),
Fetch(BoxSyncFuture<Result<Vec<Task>, Error>>),
ReenqueueOrphaned(BoxSyncFuture<Result<u64, Error>>),
Buffered(VecDeque<Task>),
Dead,
}Available on crate feature
sleep only.Expand description
Current lifecycle state of a Persistence loop.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotBootstrapped
The persistence layer has not yet been initialized.
Ready
The persistence layer is initialized and ready to perform work.
RegisterWorker(BoxSyncFuture<Result<(), Error>>)
Registering the worker with the persistence backend.
HeartBeat(BoxSyncFuture<Result<(), Error>>)
Sending a heartbeat to keep the worker alive.
ProcessEvents(BoxSyncFuture<Result<(), Error>>)
Processing task lifecycle events.
Fetch(BoxSyncFuture<Result<Vec<Task>, Error>>)
Fetching the next batch of tasks from the persistence backend.
ReenqueueOrphaned(BoxSyncFuture<Result<u64, Error>>)
Re-enqueuing tasks that were abandoned by another worker.
Buffered(VecDeque<Task>)
Tasks fetched from persistence and buffered for processing.
Dead
The persistence loop has stopped and will perform no further work.
Trait Implementations§
Auto Trait Implementations§
impl<Task, Error> !Freeze for State<Task, Error>
impl<Task, Error> RefUnwindSafe for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: RefUnwindSafe,
BoxSyncFuture<Result<Vec<Task>, Error>>: RefUnwindSafe,
BoxSyncFuture<Result<u64, Error>>: RefUnwindSafe,
VecDeque<Task>: RefUnwindSafe,
impl<Task, Error> Send for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: Send,
BoxSyncFuture<Result<Vec<Task>, Error>>: Send,
BoxSyncFuture<Result<u64, Error>>: Send,
VecDeque<Task>: Send,
impl<Task, Error> Sync for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: Sync,
BoxSyncFuture<Result<Vec<Task>, Error>>: Sync,
BoxSyncFuture<Result<u64, Error>>: Sync,
VecDeque<Task>: Sync,
impl<Task, Error> Unpin for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: Unpin,
BoxSyncFuture<Result<Vec<Task>, Error>>: Unpin,
BoxSyncFuture<Result<u64, Error>>: Unpin,
VecDeque<Task>: Unpin,
impl<Task, Error> UnsafeUnpin for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: UnsafeUnpin,
BoxSyncFuture<Result<Vec<Task>, Error>>: UnsafeUnpin,
BoxSyncFuture<Result<u64, Error>>: UnsafeUnpin,
VecDeque<Task>: UnsafeUnpin,
impl<Task, Error> UnwindSafe for State<Task, Error>where
BoxSyncFuture<Result<(), Error>>: UnwindSafe,
BoxSyncFuture<Result<Vec<Task>, Error>>: UnwindSafe,
BoxSyncFuture<Result<u64, Error>>: UnwindSafe,
VecDeque<Task>: UnwindSafe,
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
Mutably borrows from an owned value. Read more