pub struct QueueHandle { /* private fields */ }Implementations§
Source§impl QueueHandle
impl QueueHandle
pub fn new(driver: Arc<dyn QueueDriver>, registry: JobRegistry) -> Self
Sourcepub fn in_memory(_pool: PgPool) -> Self
pub fn in_memory(_pool: PgPool) -> Self
Build an in-memory queue. Works for any driver — pool ignored.
The _pool parameter is kept for ergonomics: many call sites already
have a pool handy, no need to omit the argument at every call.
Sourcepub fn in_memory_no_pool() -> Self
pub fn in_memory_no_pool() -> Self
In-memory queue without requiring a pool reference. Useful for tests and for MySQL/SQLite apps where there’s no PG pool to pass.
Sourcepub fn database(pool: PgPool) -> Self
pub fn database(pool: PgPool) -> Self
Database-backed queue. Postgres-only in v0.1 (uses SKIP LOCKED).
MySQL + SQLite database queue drivers are deferred to v0.2.
pub fn fake() -> (Self, Arc<Mutex<Vec<QueuePayload>>>)
pub fn registry(&self) -> &JobRegistry
pub async fn push(&self, payload: QueuePayload) -> Result<(), Error>
pub async fn pop(&self, queue: &str) -> Result<Option<QueuePayload>, Error>
pub async fn fail( &self, payload: QueuePayload, error: String, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for QueueHandle
impl Clone for QueueHandle
Source§fn clone(&self) -> QueueHandle
fn clone(&self) -> QueueHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QueueHandle
impl !RefUnwindSafe for QueueHandle
impl Send for QueueHandle
impl Sync for QueueHandle
impl Unpin for QueueHandle
impl UnsafeUnpin for QueueHandle
impl !UnwindSafe for QueueHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more