pub struct WorkerConfig {
pub max_event_latency: Option<Duration>,
pub max_instances: Option<usize>,
}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: Option<Duration>Maximum 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: default::MAX_EVENT_LATENCY.
max_instances: Option<usize>Maximum 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: default::MAX_CHAT_INSTANCES.
Implementations§
Source§impl WorkerConfig
impl WorkerConfig
pub fn new() -> Self
pub fn with_event_latency(self, duration: Duration) -> Self
pub fn max_instances(self, max_instances: usize) -> Self
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 more