pub struct SharedTaskQueue { /* private fields */ }Expand description
Thread-safe wrapper for TaskQueue for use in parallel sync
Implementations§
Sourcepub async fn pop_round_robin(&self) -> Result<Option<SyncTask>>
pub async fn pop_round_robin(&self) -> Result<Option<SyncTask>>
Get the next pending task using round-robin scheduling (thread-safe)
Sourcepub async fn pop_with_pipeline(
&self,
pipeline: Option<SyncPipeline>,
) -> Result<Option<SyncTask>>
pub async fn pop_with_pipeline( &self, pipeline: Option<SyncPipeline>, ) -> Result<Option<SyncTask>>
Get the next pending task for a specific pipeline (thread-safe)
Sourcepub async fn pop_round_robin_with_pipeline(
&self,
pipeline: Option<SyncPipeline>,
) -> Result<Option<SyncTask>>
pub async fn pop_round_robin_with_pipeline( &self, pipeline: Option<SyncPipeline>, ) -> Result<Option<SyncTask>>
Get the next pending task using round-robin for a pipeline (thread-safe)
Sourcepub async fn mark_in_progress(&self, task_id: i64) -> Result<()>
pub async fn mark_in_progress(&self, task_id: i64) -> Result<()>
Mark a task as in progress (thread-safe)
Sourcepub async fn mark_completed(&self, task_id: i64) -> Result<()>
pub async fn mark_completed(&self, task_id: i64) -> Result<()>
Mark a task as completed (thread-safe)
Sourcepub async fn mark_failed(
&self,
task_id: i64,
error: &str,
retry_after: Duration,
) -> Result<()>
pub async fn mark_failed( &self, task_id: i64, error: &str, retry_after: Duration, ) -> Result<()>
Mark a task as failed with retry (thread-safe)
Sourcepub async fn pending_count(&self) -> Result<u32>
pub async fn pending_count(&self) -> Result<u32>
Get count of pending tasks (thread-safe)
Sourcepub async fn pending_count_with_pipeline(
&self,
pipeline: Option<SyncPipeline>,
) -> Result<u32>
pub async fn pending_count_with_pipeline( &self, pipeline: Option<SyncPipeline>, ) -> Result<u32>
Get count of pending tasks for a pipeline (thread-safe)
Sourcepub async fn set_profile_id(&self, profile_id: i32)
pub async fn set_profile_id(&self, profile_id: i32)
Update the profile scope for queue operations (thread-safe)
Sourcepub async fn set_pipeline(&self, pipeline: Option<SyncPipeline>)
pub async fn set_pipeline(&self, pipeline: Option<SyncPipeline>)
Update the pipeline scope for queue operations (thread-safe)
Sourcepub async fn count_by_status(&self) -> Result<(u32, u32, u32, u32)>
pub async fn count_by_status(&self) -> Result<(u32, u32, u32, u32)>
Get task counts by status (thread-safe)
Sourcepub async fn recover_in_progress(&self) -> Result<u32>
pub async fn recover_in_progress(&self) -> Result<u32>
Recover tasks that were in progress (crashed) (thread-safe)
Trait Implementations§
Auto Trait Implementations§
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