pub trait OutputBatch: Closer {
// Required method
fn write_batch<'life0, 'async_trait>(
&'life0 mut self,
message_batch: MessageBatch,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn batch_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn interval<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Duration> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Batching output module utilized to write many messages to the output
based on batch_size and provided interval. Defaults are batch_size: 500, interval: 10 seconds.
The queuing mechanism is provided by the runtime and will call write_batch if the batch size
has been reached, or the desired interval has passed, whichever comes first.
Required Methods§
Sourcefn write_batch<'life0, 'async_trait>(
&'life0 mut self,
message_batch: MessageBatch,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_batch<'life0, 'async_trait>(
&'life0 mut self,
message_batch: MessageBatch,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write crate::MessageBatch to the output in accordance with the provided batching policy
Provided Methods§
Sourcefn batch_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn batch_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
returns the desired size of the crate::MessageBatch to provide the the output module