Struct stack_queue::assignment::PendingAssignment
source · Expand description
The responsibilty to process a yet to be assigned set of tasks on the queue.
Implementations§
source§impl<'a, T, const N: usize> PendingAssignment<'a, T, N>where
T: TaskQueue,
impl<'a, T, const N: usize> PendingAssignment<'a, T, N>where
T: TaskQueue,
sourcepub fn into_assignment(self) -> TaskAssignment<'a, T, N>
pub fn into_assignment(self) -> TaskAssignment<'a, T, N>
By converting into a TaskAssignment the task range responsible for processing will be
bounded and further tasks enqueued will be of a new batch. Assignment of a task range can be
deferred until resources such as database connections are ready as a way to process tasks in
larger batches. This operation is constant time and wait-free
sourcepub async fn with_blocking<F>(self, f: F) -> CompletionReceipt<T>where
F: for<'b> FnOnce(PendingAssignment<'b, T, N>) -> CompletionReceipt<T> + Send + 'static,
pub async fn with_blocking<F>(self, f: F) -> CompletionReceipt<T>where
F: for<'b> FnOnce(PendingAssignment<'b, T, N>) -> CompletionReceipt<T> + Send + 'static,
Resolve task assignment within a thread where blocking is acceptable. If the runtime would otherwise shutdown, instead it will suspend for the lifetime of this thread as to protect the underlying thread local data from being destroyed
Trait Implementations§
impl<'a, T, const N: usize> Send for PendingAssignment<'a, T, N>where
T: TaskQueue,
impl<'a, T, const N: usize> Sync for PendingAssignment<'a, T, N>where
T: TaskQueue,
<T as TaskQueue>::Task: Sync,
Auto Trait Implementations§
impl<'a, T, const N: usize> !RefUnwindSafe for PendingAssignment<'a, T, N>
impl<'a, T, const N: usize> Unpin for PendingAssignment<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for PendingAssignment<'a, T, N>
Blanket Implementations§
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
Convert
self to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
Convert
&self to an expression for Diesel’s query builder. Read more