pub struct BackendOptions {
pub thread_name: String,
pub queue_capacity: usize,
pub idle_yield_rounds: u32,
pub idle_sleep: Duration,
pub wait_for_queues_to_empty_before_exit: bool,
}Expand description
Configuration for the backend worker thread.
Fields§
§thread_name: StringName of the worker thread. Visible in thread::current().name() and
in panic-handler output.
queue_capacity: usizePer-thread queue size in bytes. Power-of-2 enforced by queue::new.
idle_yield_rounds: u32When the worker finds no work, it yield_now()s for this many rounds
before falling through to Self::idle_sleep. Two-stage backoff
trades a little CPU for lower wakeup latency under steady load.
idle_sleep: DurationSleep duration once Self::idle_yield_rounds is exhausted.
wait_for_queues_to_empty_before_exit: boolIf true, crate::shutdown drains every queue before joining the
worker.
Trait Implementations§
Source§impl Clone for BackendOptions
impl Clone for BackendOptions
Source§fn clone(&self) -> BackendOptions
fn clone(&self) -> BackendOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackendOptions
impl Debug for BackendOptions
Auto Trait Implementations§
impl Freeze for BackendOptions
impl RefUnwindSafe for BackendOptions
impl Send for BackendOptions
impl Sync for BackendOptions
impl Unpin for BackendOptions
impl UnsafeUnpin for BackendOptions
impl UnwindSafe for BackendOptions
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