pub struct PoolConfig {
pub name: String,
pub size: usize,
pub queue_size: usize,
pub event_buffer: usize,
pub grace_period: Duration,
pub dispatch: DispatchStrategy,
pub overflow_policy: OverflowPolicy,
}Expand description
Configuration for a Pool.
Fields§
§name: StringHuman-readable name used in tracing.
size: usizeMaximum concurrent tasks (semaphore permits).
queue_size: usizeCapacity of the internal submit queue.
event_buffer: usizeBroadcast channel capacity for events per task.
grace_period: DurationGrace period given to in-flight tasks on shutdown.
dispatch: DispatchStrategyDispatch strategy (reserved for future multi-queue extensions).
overflow_policy: OverflowPolicyQueue overflow behavior.
Implementations§
Source§impl PoolConfig
impl PoolConfig
Sourcepub fn new(name: impl Into<String>) -> PoolConfig
pub fn new(name: impl Into<String>) -> PoolConfig
Create a named pool configuration with sensible defaults.
Sourcepub fn with_size(self, size: usize) -> PoolConfig
pub fn with_size(self, size: usize) -> PoolConfig
Set the maximum number of concurrent tasks.
Values below 1 are clamped to 1 inside Pool::new (with a tracing warning),
since a zero-sized pool can never execute tasks.
Sourcepub fn with_queue_size(self, queue_size: usize) -> PoolConfig
pub fn with_queue_size(self, queue_size: usize) -> PoolConfig
Set the capacity of the internal submit queue.
Sourcepub fn with_grace_period(self, d: Duration) -> PoolConfig
pub fn with_grace_period(self, d: Duration) -> PoolConfig
Set the grace period given to in-flight tasks during shutdown.
Sourcepub fn with_overflow_policy(self, overflow_policy: OverflowPolicy) -> PoolConfig
pub fn with_overflow_policy(self, overflow_policy: OverflowPolicy) -> PoolConfig
Set the queue overflow policy.
Trait Implementations§
Source§impl Default for PoolConfig
impl Default for PoolConfig
Source§fn default() -> PoolConfig
fn default() -> PoolConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.