pub struct CallQueue { /* private fields */ }Implementations§
Source§impl CallQueue
impl CallQueue
Sourcepub fn start<F>(host: Host, opts: QueueOptions, work: F) -> CallQueue
pub fn start<F>(host: Host, opts: QueueOptions, work: F) -> CallQueue
Start opts.threads workers running work on each call pushed — and
on calls saved by the last shutdown, first.
Sourcepub fn start_by<L, F>(
host: Host,
opts: QueueOptions,
lane: L,
work: F,
) -> CallQueuewhere
L: Fn(&ConcludedCall) -> String + Send + Sync + 'static,
F: Fn(&ConcludedCall) -> Attempt + Send + Sync + 'static,
pub fn start_by<L, F>(
host: Host,
opts: QueueOptions,
lane: L,
work: F,
) -> CallQueuewhere
L: Fn(&ConcludedCall) -> String + Send + Sync + 'static,
F: Fn(&ConcludedCall) -> Attempt + Send + Sync + 'static,
start, with each call put in the lane lane names
(the server it goes to, say): each lane has opts.threads workers of
its own, and its own retries and endpoint status. Calls saved by the
last shutdown are put in the lane lane names for them now.
pub fn push(&self, call: ConcludedCall)
pub fn is_empty(&self) -> bool
Sourcepub fn shutdown(&mut self, grace: Duration)
pub fn shutdown(&mut self, grace: Duration)
Work what’s ready until grace is nearly up; save the rest (or fail it).
Call it from crate::Plugin::shutdown; calls pushed after it are refused.
Auto Trait Implementations§
impl !Freeze for CallQueue
impl !RefUnwindSafe for CallQueue
impl !UnwindSafe for CallQueue
impl Send for CallQueue
impl Sync for CallQueue
impl Unpin for CallQueue
impl UnsafeUnpin for CallQueue
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