pub struct QueueConfig {
pub redis_url: String,
pub queue_name: String,
pub key_prefix: String,
pub max_size: usize,
pub retention_time: Duration,
}Expand description
Queue configuration.
Fields§
§redis_url: StringRedis connection URL
queue_name: StringQueue name
key_prefix: StringKey prefix for Redis keys
max_size: usizeMaximum queue size (0 = unlimited)
retention_time: DurationJob retention time for completed jobs
Implementations§
Source§impl QueueConfig
impl QueueConfig
Sourcepub fn new(redis_url: impl Into<String>, queue_name: impl Into<String>) -> Self
pub fn new(redis_url: impl Into<String>, queue_name: impl Into<String>) -> Self
Create a new queue configuration.
Sourcepub fn with_key_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_key_prefix(self, prefix: impl Into<String>) -> Self
Set the key prefix.
Sourcepub fn with_max_size(self, max_size: usize) -> Self
pub fn with_max_size(self, max_size: usize) -> Self
Set the maximum queue size.
Sourcepub fn with_retention_time(self, retention_time: Duration) -> Self
pub fn with_retention_time(self, retention_time: Duration) -> Self
Set the retention time for completed jobs.
Trait Implementations§
Source§impl Clone for QueueConfig
impl Clone for QueueConfig
Source§fn clone(&self) -> QueueConfig
fn clone(&self) -> QueueConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueueConfig
impl RefUnwindSafe for QueueConfig
impl Send for QueueConfig
impl Sync for QueueConfig
impl Unpin for QueueConfig
impl UnwindSafe for QueueConfig
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