ReceiverDrainX<T> extension
Bulk receiving operations for Receiver.
Efficiently drain multiple values from channels with different strategies for handling timeouts and limits. Essential for batch processing.
Usage:
// Drain all immediately available
final available = rx.tryRecvAll(max: 100);
// Wait and batch with timeout
final batch = await rx.recvAll(
idle: Duration(milliseconds: 100),
max: 50,
);
- on
-
- Receiver<
T>
- Receiver<
Methods
-
recvAll(
{Duration idle = Duration.zero, int? max}) → Future< Iterable< T> > -
Available on Receiver<
Receive multiple values with batching and idle timeout.T> , provided by the ReceiverDrainX extension -
tryRecvAll(
{int? max}) → Iterable< T> -
Available on Receiver<
Drain all immediately available values without waiting.T> , provided by the ReceiverDrainX extension