pub struct QueueManager { /* private fields */ }Implementations§
Source§impl QueueManager
impl QueueManager
Sourcepub fn new(driver: Box<dyn QueueInterface>) -> Self
pub fn new(driver: Box<dyn QueueInterface>) -> Self
Creates a new QueueManager wrapping a specific driver implementation.
Sourcepub async fn add_to_queue(&self, queue_name: &str, data: JobData) -> Result<()>
pub async fn add_to_queue(&self, queue_name: &str, data: JobData) -> Result<()>
Adds data to the specified queue via the underlying driver.
Sourcepub async fn process_queue(
&self,
queue_name: &str,
callback: JobProcessorFnAsync,
) -> Result<()>
pub async fn process_queue( &self, queue_name: &str, callback: JobProcessorFnAsync, ) -> Result<()>
Registers a processor for the specified queue and starts processing (if applicable for the driver).
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnects the underlying driver (if necessary).
Sourcepub async fn check_health(&self) -> Result<()>
pub async fn check_health(&self) -> Result<()>
Checks the health of the underlying queue driver.
Auto Trait Implementations§
impl Freeze for QueueManager
impl !RefUnwindSafe for QueueManager
impl Send for QueueManager
impl Sync for QueueManager
impl Unpin for QueueManager
impl UnsafeUnpin for QueueManager
impl !UnwindSafe for QueueManager
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