Struct CompletionThreads
pub struct CompletionThreads { /* private fields */ }std and tcp only.Expand description
How many threads complete the posted receives of the process.
Every PostedRecv of the process shares these
threads, which only exist on Windows; elsewhere this configures nothing.
They start as needed: one when the first stream is wrapped, then another
whenever the running ones are all busy with a backlog of completions, up
to max_threads. A thread that has nothing to do for
idle_timeout exits, as long as
min_threads keep running.
Use set_completion_threads to change it for the process.
Implementations§
§impl CompletionThreads
impl CompletionThreads
pub fn new() -> CompletionThreads
pub fn new() -> CompletionThreads
The default: at least one thread, at most one per CPU up to eight, and a thread above the minimum exits after 30 seconds without work.
pub fn single() -> CompletionThreads
pub fn single() -> CompletionThreads
Always exactly one thread, which never scales.
pub fn with_min_threads(self, threads: usize) -> CompletionThreads
pub fn with_min_threads(self, threads: usize) -> CompletionThreads
Threads kept running even without work (at least 1). Raises the maximum to match if needed.
pub fn set_min_threads(&mut self, threads: usize) -> &mut CompletionThreads
pub fn set_min_threads(&mut self, threads: usize) -> &mut CompletionThreads
Threads kept running even without work (at least 1). Raises the maximum to match if needed.
pub fn with_max_threads(self, threads: usize) -> CompletionThreads
pub fn with_max_threads(self, threads: usize) -> CompletionThreads
Most threads started under load (at least the minimum).
pub fn set_max_threads(&mut self, threads: usize) -> &mut CompletionThreads
pub fn set_max_threads(&mut self, threads: usize) -> &mut CompletionThreads
Most threads started under load (at least the minimum).
pub fn with_idle_timeout(self, timeout: Duration) -> CompletionThreads
pub fn with_idle_timeout(self, timeout: Duration) -> CompletionThreads
How long a thread above the minimum waits for work before it exits (at least one millisecond).
pub fn set_idle_timeout(&mut self, timeout: Duration) -> &mut CompletionThreads
pub fn set_idle_timeout(&mut self, timeout: Duration) -> &mut CompletionThreads
How long a thread above the minimum waits for work before it exits (at least one millisecond).
pub const fn min_threads(&self) -> usize
pub const fn min_threads(&self) -> usize
Threads kept running even without work.
pub const fn max_threads(&self) -> usize
pub const fn max_threads(&self) -> usize
Most threads started under load.
pub const fn idle_timeout(&self) -> Duration
pub const fn idle_timeout(&self) -> Duration
How long a thread above the minimum waits for work before it exits.
Trait Implementations§
§impl Clone for CompletionThreads
impl Clone for CompletionThreads
§fn clone(&self) -> CompletionThreads
fn clone(&self) -> CompletionThreads
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompletionThreads
§impl Debug for CompletionThreads
impl Debug for CompletionThreads
§impl Default for CompletionThreads
impl Default for CompletionThreads
§fn default() -> CompletionThreads
fn default() -> CompletionThreads
impl Eq for CompletionThreads
§impl PartialEq for CompletionThreads
impl PartialEq for CompletionThreads
impl StructuralPartialEq for CompletionThreads
Auto Trait Implementations§
impl Freeze for CompletionThreads
impl RefUnwindSafe for CompletionThreads
impl Send for CompletionThreads
impl Sync for CompletionThreads
impl Unpin for CompletionThreads
impl UnsafeUnpin for CompletionThreads
impl UnwindSafe for CompletionThreads
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more