pub trait BatchingPort: Send + Sync {
// Required methods
fn add_to_batch(&self, entry: LogEntry) -> ObservabilityResult<()>;
fn flush_batch(&self) -> ObservabilityResult<()>;
fn batch_size(&self) -> usize;
}Expand description
Port for batching log entries
This allows different batching strategies:
- TimeBasedBatcher (flush every N seconds)
- SizeBasedBatcher (flush when buffer reaches N entries)
- HybridBatcher (combination of time and size)
Required Methods§
Sourcefn add_to_batch(&self, entry: LogEntry) -> ObservabilityResult<()>
fn add_to_batch(&self, entry: LogEntry) -> ObservabilityResult<()>
Add an entry to the batch
Sourcefn flush_batch(&self) -> ObservabilityResult<()>
fn flush_batch(&self) -> ObservabilityResult<()>
Force flush the current batch
Sourcefn batch_size(&self) -> usize
fn batch_size(&self) -> usize
Get current batch size