Struct multistream_batch::channel::tx_buf_batch::TxBufBatchChannel[][src]

pub struct TxBufBatchChannel<I: Debug> { /* fields omitted */ }
Expand description

Batches items in internal buffer up to max_size items or until max_duration has elapsed since the first item appended to the batch. Reference to each item is returned for every received item as soon as they are received.

The current batch can be retried. Iteration will yield not committed items again.

Implementations

Creates batch given maximum batch size in the number of items stored (max_size) and maximum duration that batch can last (max_duration) since the first item appended to it. Parameter channel_size defines the maximum number of messages that can be buffered between sender and receiver.

This method also returns CommandSender endpoint that can be used to send Commands.

Panics if max_size == 0.

Calls producer closure with CommandSender end of the channel in a newly started thread and returns TxBufBatchChannel connected to that CommandSender.

Gets next item reference received by the batch or signal that the batch is now complete and can be retried or committed.

This call will block until batch becomes ready.

When the CommandSender end has dropped, this method returns with Err(EndOfStreamError) after all outstanding items were flushed.

Pops last item returned by next from internal buffer - it won’t be retried.

Can be called multiple times to consume the internal buffer starting at last next item position.

Checks if previous self.next() call found channel to be disconnected.

Restarts batch making self.next() to iterate already appended items starting from oldest one in current batch.

Starts new batch dropping all buffered items.

Starts new batch by draining all buffered items.

Returns slice of internal item buffer.

Returns number of buffered items.

Returns number of buffered items that were already visited by the next call in current batch.

Converts into internal item buffer.

Converts to an iterator that will drain all buffered items first and then all items from the channel.

Splits into BufBatch item buffer and channel Receiver end.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.