pub struct RedisJobQueue { /* private fields */ }Expand description
Redis-based job queue implementation for production use
Implementations§
Source§impl RedisJobQueue
impl RedisJobQueue
Sourcepub fn new(redis_url: &str, queue_name: &str) -> Result<Self>
pub fn new(redis_url: &str, queue_name: &str) -> Result<Self>
Create a new Redis job queue
§Arguments
redis_url- Redis connection URL (e.g., “redis://127.0.0.1:6379”)queue_name- Name of the queue (will be prefixed with “riglr:queue:”)
Sourcepub fn with_timeout(self, timeout_seconds: u64) -> Self
pub fn with_timeout(self, timeout_seconds: u64) -> Self
Set the blocking timeout for dequeue operations
Trait Implementations§
Source§impl JobQueue for RedisJobQueue
impl JobQueue for RedisJobQueue
Source§fn enqueue<'life0, 'async_trait>(
&'life0 self,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn enqueue<'life0, 'async_trait>(
&'life0 self,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a job to the queue
Source§fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next job from the queue, blocks until a job is available or timeout
Source§fn dequeue_with_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue_with_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next job from the queue with timeout
Auto Trait Implementations§
impl Freeze for RedisJobQueue
impl RefUnwindSafe for RedisJobQueue
impl Send for RedisJobQueue
impl Sync for RedisJobQueue
impl Unpin for RedisJobQueue
impl UnwindSafe for RedisJobQueue
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