pub struct WorkerConfig {
pub max_event_latency: Duration,
pub max_instances: usize,
pub max_cmds_per_iter: usize,
pub max_events_per_iter: usize,
}ffi only.Expand description
Configuration for the shared FFI worker thread.
Applies only on the first init or init_with_config call. All subsequent calls reuse
the already running worker thread and ignore this parameter entirely.
Fields§
§max_event_latency: DurationMaximum permissible event latency. Controls how long the worker thread may sleep between polling cycles when all chats are idle. The sleep interval grows linearly from zero up to this value as idle time accumulates. Sending any command resets the interval immediately by waking the thread. Default: 1sec
max_instances: usizeMaximum number of chat instances the worker thread will serve simultaneously. init
returns CallError::Failure when this limit is reached. Passing 0 is valid but
prevents any chat from ever being created. Default: 20
max_cmds_per_iter: usizeMaximum number of commands executed per chat instance per scheduling iteration. Higher values improve throughput under command bursts at the cost of increased latency for other chat instances. Default: 3
max_events_per_iter: usizeMaximum number of events drained per chat instance per scheduling iteration. Higher values reduce event latency under event bursts at the cost of increased command latency for other chat instances. Default 6
Implementations§
Source§impl WorkerConfig
impl WorkerConfig
pub fn new() -> WorkerConfig
pub fn with_event_latency(self, duration: Duration) -> WorkerConfig
pub fn max_instances(self, max_instances: usize) -> WorkerConfig
pub fn max_cmds_per_iter(self, max_cmds: usize) -> WorkerConfig
pub fn max_events_per_iter(self, max_events: usize) -> WorkerConfig
Trait Implementations§
Source§impl Clone for WorkerConfig
impl Clone for WorkerConfig
Source§fn clone(&self) -> WorkerConfig
fn clone(&self) -> WorkerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerConfig
impl Debug for WorkerConfig
Source§impl Default for WorkerConfig
impl Default for WorkerConfig
Source§fn default() -> WorkerConfig
fn default() -> WorkerConfig
Auto Trait Implementations§
impl Freeze for WorkerConfig
impl RefUnwindSafe for WorkerConfig
impl Send for WorkerConfig
impl Sync for WorkerConfig
impl Unpin for WorkerConfig
impl UnsafeUnpin for WorkerConfig
impl UnwindSafe for WorkerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().