pub struct QueueManager { /* private fields */ }Expand description
Queue manager
Implementations§
Source§impl QueueManager
impl QueueManager
pub fn new() -> Self
Sourcepub fn enqueue(&mut self, request: InferenceRequest)
pub fn enqueue(&mut self, request: InferenceRequest)
Enqueue a pending inference request.
Sourcepub fn dequeue(&mut self) -> Option<InferenceRequest>
pub fn dequeue(&mut self) -> Option<InferenceRequest>
Dequeue the next pending request (FIFO order).
Sourcepub fn start_request(&mut self, running: RunningRequest)
pub fn start_request(&mut self, running: RunningRequest)
Mark a request as running on a given backend.
Sourcepub fn complete_request(
&mut self,
request_id: &str,
completed: CompletedRequest,
)
pub fn complete_request( &mut self, request_id: &str, completed: CompletedRequest, )
Mark a running request as completed, removing it from the running set and appending it to the completed list.
Sourcepub fn pending_requests(&self) -> &[InferenceRequest]
pub fn pending_requests(&self) -> &[InferenceRequest]
Return a reference to the pending requests queue.
Sourcepub fn running_requests(&self) -> &HashMap<String, RunningRequest>
pub fn running_requests(&self) -> &HashMap<String, RunningRequest>
Return a reference to the running requests map.
Sourcepub fn completed_requests(&self) -> &[CompletedRequest]
pub fn completed_requests(&self) -> &[CompletedRequest]
Return a reference to the completed requests list.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of pending requests.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Number of currently running requests.
Auto Trait Implementations§
impl Freeze for QueueManager
impl RefUnwindSafe for QueueManager
impl Send for QueueManager
impl Sync for QueueManager
impl Unpin for QueueManager
impl UnsafeUnpin for QueueManager
impl UnwindSafe for QueueManager
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