streamly
streamly copied to clipboard
Ahead streams might dispatch too many workers doing nothing
When we execute this:
> stream1 = Stream.sequence $ Stream.fromList [delay 2, delay 2, delay 2]
> stream2 = Stream.sequence $ Stream.replicate 5 (delay 1)
> Stream.fold Fold.toList $ Async.concatWith (Async.stopWhen Async.AnyStops . Async.inspectMode . Async.ordered) $ Stream.fromList [stream1, stream2]
Sometimes it leads to dispatching too many workers, ideally it should not dispatch more than a few. See also #1921 .
This seems to happen when we add some prints or traces in the code, may be due to some race condition.