The type of items in the feed
The maximum number of items per batch, defaulting to 0; values less than 1 are treated as unbounded,
collecting the whole feed into a single batch
A task yielding the read-only lists of the items collected into each batch
Creates a task collecting consecutive items into fixed-size batches.
Batches are emitted as soon as they fill up, in source order and with items in source order, so only one batch is held in memory at a time; the last batch is emitted short if the feed ends before it fills up, and no batch is emitted at all for an empty feed.
An unbounded
sizeaccumulates the whole feed in memory before emitting the single batch holding it. For large or infinite feeds, this may exhaust memory or never complete: batch by a positive size to keep consumption bounded.