pub struct RedisPersistence<Conn = ConnectionManager> { /* private fields */ }Expand description
The default persistence implementation
Trait Implementations§
Source§impl<C: Clone> Clone for RedisPersistence<C>
impl<C: Clone> Clone for RedisPersistence<C>
Source§impl<Conn: Debug> Debug for RedisPersistence<Conn>
impl<Conn: Debug> Debug for RedisPersistence<Conn>
Source§impl<C> Persistence for RedisPersistence<C>
impl<C> Persistence for RedisPersistence<C>
Source§async fn register(&mut self, worker: &WorkerContext) -> Result<(), Error>
async fn register(&mut self, worker: &WorkerContext) -> Result<(), Error>
Registers the worker with the persistence backend.
Source§async fn heartbeat(&mut self, worker: &WorkerContext) -> Result<(), Error>
async fn heartbeat(&mut self, worker: &WorkerContext) -> Result<(), Error>
Records a heartbeat for the worker.
Source§async fn fetch_next(
&mut self,
worker: &WorkerContext,
) -> Result<Vec<RedisTask>, Error>
async fn fetch_next( &mut self, worker: &WorkerContext, ) -> Result<Vec<RedisTask>, Error>
Fetches the next batch of tasks available for processing.
Source§async fn handle_events(
&mut self,
messages: Vec<TaskEvent<Self::Response>>,
worker: &WorkerContext,
) -> Result<(), Error>
async fn handle_events( &mut self, messages: Vec<TaskEvent<Self::Response>>, worker: &WorkerContext, ) -> Result<(), Error>
Handles task lifecycle events produced by the worker.
Source§async fn reenqueue_abandoned(
&mut self,
tasks: Vec<RedisTask>,
worker: &WorkerContext,
) -> Result<u64, Error>
async fn reenqueue_abandoned( &mut self, tasks: Vec<RedisTask>, worker: &WorkerContext, ) -> Result<u64, Error>
Re-enqueues tasks that were abandoned by a worker.
Auto Trait Implementations§
impl<Conn> Freeze for RedisPersistence<Conn>where
Conn: Freeze,
impl<Conn> RefUnwindSafe for RedisPersistence<Conn>where
Conn: RefUnwindSafe,
impl<Conn> Send for RedisPersistence<Conn>where
Conn: Send,
impl<Conn> Sync for RedisPersistence<Conn>where
Conn: Sync,
impl<Conn> Unpin for RedisPersistence<Conn>where
Conn: Unpin,
impl<Conn> UnsafeUnpin for RedisPersistence<Conn>where
Conn: UnsafeUnpin,
impl<Conn> UnwindSafe for RedisPersistence<Conn>where
Conn: 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