lazy-collections
lazy-collections copied to clipboard
Add `eager` utility
I like this direction @RobinMalfait ! The wait function is a great way to make intention clear in a program.
As described in the readme update, this eager() function processes batches of a fixed size, so I suggest actually calling it batch(), to clarify the grouped-processing behaviour. Does that make sense? Or would the batch name intuitively indicate some other collection-operation?
Then if we proceed to add more functions in this style, what I called eager() (in the draft in #4) could perhaps be named parallel() instead. That one would start processing a new next() as soon as any slot is free in the "buffer", not waiting for the full batch to complete.
And then add race() too, if we want a variant that mess with collection order (that will be a challenge to write some solid tests for 😄).
knock knock is this thing still on?
Welp, it took a while, but let's get this thing merged!