pub struct PerThreadConfig {
pub workers: usize,
pub pin_to_core: bool,
pub backlog: i32,
pub drain_timeout: Duration,
}Available on crate feature
per-thread only.Expand description
Configuration for serve_per_thread (and the compio variant when enabled).
Fields§
§workers: usizeNumber of worker threads. Defaults to the number of logical CPUs.
pin_to_core: boolPin each worker to a CPU core (requires the affinity feature).
backlog: i32SO_REUSEPORT listen backlog.
drain_timeout: DurationMaximum time the coordinator waits for in-flight requests after shutdown. Workers are dropped after this elapses.
Trait Implementations§
Source§impl Clone for PerThreadConfig
impl Clone for PerThreadConfig
Source§fn clone(&self) -> PerThreadConfig
fn clone(&self) -> PerThreadConfig
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 PerThreadConfig
impl Debug for PerThreadConfig
Source§impl Default for PerThreadConfig
impl Default for PerThreadConfig
Source§fn default() -> PerThreadConfig
fn default() -> PerThreadConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PerThreadConfig
impl RefUnwindSafe for PerThreadConfig
impl Send for PerThreadConfig
impl Sync for PerThreadConfig
impl Unpin for PerThreadConfig
impl UnsafeUnpin for PerThreadConfig
impl UnwindSafe for PerThreadConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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