streamly
streamly copied to clipboard
Improve takeByTime
There are two takebyTime combinators, one in IsStream module and the other one in Fold module. Both could be quite inefficient because of the way they are implemented. One use getTime and the other one starts a timer thread for each time window.
We can implement these efficiently by using the more efficient timestamped or other stream timestamping functions like times. We can then use the timestamps to do the time based chunking. Basically, the time based chunking functions should work on an already timestamped stream.
This will not work as
takeByTimeis implemented incorrectly- This combinator should run a supervisor that should terminate the underlying action if time exceeds. I clearly remember talking about this. I remember documenting this somewhere as well but I'm unable to find the doc.
single element stream timeout paallelFst stream
See https://github.com/composewell/streamly/issues/1675