pub struct JobQueue { /* private fields */ }Expand description
In-process job queue. HTTP dispatch is performed by the caller via
submit_fn passed to process_queue.
Implementations§
Source§impl JobQueue
impl JobQueue
pub fn new() -> Self
Sourcepub async fn process_queue<F>(&self, dispatch: F) -> Result<(), QpuError>
pub async fn process_queue<F>(&self, dispatch: F) -> Result<(), QpuError>
Drain the pending queue and call dispatch for each job.
dispatch should return the provider-assigned job ID on success.
Sourcepub async fn record_result(&self, job_id: &str, result: QpuResult)
pub async fn record_result(&self, job_id: &str, result: QpuResult)
Mark a running job as completed or failed based on a polled status.
Sourcepub async fn take_results(&self) -> Vec<QpuResult>
pub async fn take_results(&self) -> Vec<QpuResult>
Drain and return all completed results.
pub async fn stats(&self) -> QueueStats
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobQueue
impl !RefUnwindSafe for JobQueue
impl Send for JobQueue
impl Sync for JobQueue
impl Unpin for JobQueue
impl UnsafeUnpin for JobQueue
impl !UnwindSafe for JobQueue
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.