Sequences.limit(Sequences.withEffect(Sequences.simple(Arrays.asList(1, 2, 3)), ...), 3)
doesn't execute the effect. It looks like a bug to me. I don't see how it could be fixed with the current Yielder's API: isDone(), next(), and close(). Fixing the API would be a massive change, and I don't want to risk doing this change and rewrite very convoluted logic of Combining, Merging, Filtered, Limited Sequences.
FYI RxJava which has Flowable, the abstraction very similar to Sequence, uses Publisher/Subscriber model instead of "external" model like Yielder. Probably pub/sub allows to avoid such issues.
doesn't execute the effect. It looks like a bug to me. I don't see how it could be fixed with the current Yielder's API:
isDone(),next(), andclose(). Fixing the API would be a massive change, and I don't want to risk doing this change and rewrite very convoluted logic of Combining, Merging, Filtered, Limited Sequences.FYI RxJava which has
Flowable, the abstraction very similar toSequence, uses Publisher/Subscriber model instead of "external" model likeYielder. Probably pub/sub allows to avoid such issues.