pub struct RedisBroker { /* private fields */ }
Implementations§
Source§impl RedisBroker
impl RedisBroker
pub async fn new(redis_url: &str) -> Result<Self, TaskQueueError>
pub async fn new_with_config( redis_url: &str, pool_size: Option<usize>, ) -> Result<Self, TaskQueueError>
pub async fn enqueue_task<T: Task>( &self, task: T, queue: &str, ) -> Result<TaskId, TaskQueueError>
Sourcepub async fn enqueue_task_wrapper(
&self,
task_wrapper: TaskWrapper,
queue: &str,
) -> Result<TaskId, TaskQueueError>
pub async fn enqueue_task_wrapper( &self, task_wrapper: TaskWrapper, queue: &str, ) -> Result<TaskId, TaskQueueError>
Enhanced enqueue with security validation
Sourcepub async fn enqueue_tasks_batch<T: Task>(
&self,
tasks: Vec<(T, &str)>,
) -> Result<Vec<TaskId>, TaskQueueError>
pub async fn enqueue_tasks_batch<T: Task>( &self, tasks: Vec<(T, &str)>, ) -> Result<Vec<TaskId>, TaskQueueError>
Batch enqueue multiple tasks for better throughput
pub async fn dequeue_task( &self, queues: &[String], ) -> Result<Option<TaskWrapper>, TaskQueueError>
pub async fn get_queue_size(&self, queue: &str) -> Result<i64, TaskQueueError>
pub async fn get_queue_metrics( &self, queue: &str, ) -> Result<QueueMetrics, TaskQueueError>
pub async fn mark_task_completed( &self, task_id: TaskId, queue: &str, ) -> Result<(), TaskQueueError>
pub async fn mark_task_failed_with_reason( &self, task_id: TaskId, queue: &str, reason: Option<String>, ) -> Result<(), TaskQueueError>
pub async fn mark_task_failed( &self, task_id: TaskId, queue: &str, ) -> Result<(), TaskQueueError>
pub async fn get_active_workers(&self) -> Result<i64, TaskQueueError>
pub async fn register_worker( &self, worker_id: &str, ) -> Result<(), TaskQueueError>
pub async fn unregister_worker( &self, worker_id: &str, ) -> Result<(), TaskQueueError>
pub async fn update_worker_heartbeat( &self, worker_id: &str, ) -> Result<(), TaskQueueError>
pub async fn get_task_failure_info( &self, task_id: TaskId, ) -> Result<Option<TaskFailureInfo>, TaskQueueError>
pub async fn get_failed_tasks( &self, queue: &str, ) -> Result<Vec<String>, TaskQueueError>
Auto Trait Implementations§
impl Freeze for RedisBroker
impl !RefUnwindSafe for RedisBroker
impl Send for RedisBroker
impl Sync for RedisBroker
impl Unpin for RedisBroker
impl !UnwindSafe for RedisBroker
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