pub struct TaskQueue { /* private fields */ }Expand description
Task queue backed by DuckDB for persistence
Implementations§
Source§impl TaskQueue
impl TaskQueue
Sourcepub fn mark_in_progress(&self, task_id: i64) -> Result<()>
pub fn mark_in_progress(&self, task_id: i64) -> Result<()>
Mark a task as in progress
Sourcepub fn mark_completed(&self, task_id: i64) -> Result<()>
pub fn mark_completed(&self, task_id: i64) -> Result<()>
Mark a task as completed
Sourcepub fn mark_failed(
&self,
task_id: i64,
error: &str,
retry_after: Duration,
) -> Result<()>
pub fn mark_failed( &self, task_id: i64, error: &str, retry_after: Duration, ) -> Result<()>
Mark a task as failed with retry
Sourcepub fn recover_in_progress(&self) -> Result<u32>
pub fn recover_in_progress(&self) -> Result<u32>
Recover tasks that were in progress (crashed)
Sourcepub fn pending_count(&self) -> Result<i64>
pub fn pending_count(&self) -> Result<i64>
Get count of pending tasks
Sourcepub fn reset_failed(&self) -> Result<u32>
pub fn reset_failed(&self) -> Result<u32>
Reset all failed tasks to pending (clear retry delays)
Sourcepub fn clear_pending(&self) -> Result<u32>
pub fn clear_pending(&self) -> Result<u32>
Clear all pending and failed tasks
Auto Trait Implementations§
impl Freeze for TaskQueue
impl RefUnwindSafe for TaskQueue
impl Send for TaskQueue
impl Sync for TaskQueue
impl Unpin for TaskQueue
impl UnwindSafe for TaskQueue
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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