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
TypeError If size is not an integer
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; 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.
sizeis positive, so the reported feed runs dry as the feed drawn from does; an unboundedsizedrains the whole feed before emitting the single batch holding it, so an infinite feed never completes.sizeholds the whole feed in memory, so a large feed may exhaust it; batch by a positive size to keep consumption bounded.