drain

Function drain 

Source
pub async fn drain<DT, ET>(
    config: &Config<DT, ET>,
    ctx: ContextValue<DT>,
    queue: impl Queue,
) -> Result<DrainStats, OxanusError>
where DT: Send + Sync + Clone + 'static, ET: Error + Send + Sync + 'static,
Expand description

Drains a queue of jobs.

This function will drain a queue of jobs, processing them one by one.

It is useful in development or testing to process a queue of jobs without running the full worker.

§Arguments

  • config - The worker configuration, including queue and worker registrations
  • ctx - The context value that will be shared across all worker instances
  • queue - The queue to drain

§Returns

Returns statistics about the drain operation, or an OxanusError if the operation fails.