pub struct MessageBatchConfig {
pub max_chunks: usize,
pub flush_interval_ms: Option<u64>,
}Expand description
Configuration for batching LLM streaming chunks.
Controls how token chunks are accumulated before forwarding to stream consumers. Batching reduces overhead for high-volume token streaming by coalescing small chunks into fewer, larger deliveries.
Fields§
§max_chunks: usizeMaximum number of chunks to accumulate before flushing.
When this many chunks are collected, they are flushed immediately regardless of the time threshold.
flush_interval_ms: Option<u64>Maximum time in milliseconds to wait before flushing.
If this duration elapses without reaching max_chunks, the
accumulated chunks are flushed. A value of None disables
time-based flushing.
Implementations§
Trait Implementations§
Source§impl Clone for MessageBatchConfig
impl Clone for MessageBatchConfig
Source§fn clone(&self) -> MessageBatchConfig
fn clone(&self) -> MessageBatchConfig
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 MessageBatchConfig
impl Debug for MessageBatchConfig
Auto Trait Implementations§
impl Freeze for MessageBatchConfig
impl RefUnwindSafe for MessageBatchConfig
impl Send for MessageBatchConfig
impl Sync for MessageBatchConfig
impl Unpin for MessageBatchConfig
impl UnsafeUnpin for MessageBatchConfig
impl UnwindSafe for MessageBatchConfig
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