pub struct PendingBulk { /* private fields */ }Expand description
Several jobs on their way to the queue together.
Await the PendingBulk to push the jobs in as few round trips as the connection’s driver
allows. Awaiting returns the jobs’ JobIds in order. The errors and panics of awaiting are
listed on queue::bulk.
Each job keeps its own options and middleware, and goes to its own queue unless
on_queue chooses one queue for all of them. Inside a database transaction,
Laravel holds the jobs until the transaction commits, as it does for a
dispatch.
use laravel::queue;
let jobs = subscribers
.into_iter()
.map(|subscriber_id| NotifySubscriber { subscriber_id });
queue::bulk(jobs).on_queue("notifications").await?;Implementations§
Source§impl PendingBulk
impl PendingBulk
Sourcepub fn on_connection(self, connection: impl Into<String>) -> PendingBulk
pub fn on_connection(self, connection: impl Into<String>) -> PendingBulk
Push the jobs to this connection rather than the default one.
Sourcepub fn on_queue(self, queue: impl Into<String>) -> PendingBulk
pub fn on_queue(self, queue: impl Into<String>) -> PendingBulk
Push the jobs to this queue, rather than the queues that their options or connection choose.
Trait Implementations§
Source§impl Debug for PendingBulk
impl Debug for PendingBulk
Source§impl IntoFuture for PendingBulk
impl IntoFuture for PendingBulk
Source§type Output = Result<Vec<JobId>, Error>
type Output = Result<Vec<JobId>, Error>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<Vec<JobId>, Error>> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<Vec<JobId>, Error>> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> <PendingBulk as IntoFuture>::IntoFuture
fn into_future(self) -> <PendingBulk as IntoFuture>::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PendingBulk
impl !UnwindSafe for PendingBulk
impl Forget for PendingBulk
impl Freeze for PendingBulkwhere
*const u8 is !null: Freeze,
PhantomData<Link>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
PhantomData<u8>: Freeze,
&'static Location<'static>: Freeze,
impl Move for PendingBulk
impl Send for PendingBulk
impl Sync for PendingBulk
impl Unpin for PendingBulk
impl UnsafeUnpin for PendingBulkwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Link>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreCreates a shared type from an unshared type.