pub struct Queue { /* private fields */ }Expand description
A celerix Queue handle.
Wraps worker::Queue and provides a clean dispatch() method for jobs.
Injected automatically as an axum Extension<Queue> by #[celerix::main].
Implementations§
Source§impl Queue
impl Queue
Sourcepub fn dispatch<'a, T>(
&'a self,
job: T,
) -> SendFuture<impl Future<Output = Result<(), Error>> + 'a> ⓘ
pub fn dispatch<'a, T>( &'a self, job: T, ) -> SendFuture<impl Future<Output = Result<(), Error>> + 'a> ⓘ
Dispatch a job to its queue.
The queue binding is resolved automatically from the job’s
queue_binding() (prefixed with the project name).
Returns a Send future so no #[celerix::send] is needed on handlers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Queue
impl RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl UnsafeUnpin for Queue
impl UnwindSafe for Queue
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