-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrent stream #164
Concurrent stream #164
Conversation
8abb325
to
2e1aa2d
Compare
This should be good for review now I reckon. It's all implemented and working, just not fully documented and maybe,, smooth? But yeah, I think it's good now for people to start taking a look! |
Oh I guess maybe one more TODO item we could do here is remove the |
Oh and for anyone wondering about CI: nightly is currently broken because of rust-lang/rust#121708. |
da0c3de
to
8bed249
Compare
@matheus-consoli I think this PR should be ready to be merged - can I ask you to work your magic to enable CI to pass? |
🪄 simsalabim faça o CI funcionar pra mim 🪄 |
This implements a system for concurrent handling of items in streams.
Pitch: we don't want to ever work with a
Stream<Item = impl Future>
for concurrency; what we really want is aConcurrentAsyncIterator
trait which does all the right things for us. That means the solution to "barbara battles buffered streams" is to tell her not to put futures inside of streams, and instead use "concurrent streams" directly.This is likely a more robust direction than trying to weave a new
poll_bg
/poll_progress
method through every future and async iterator. If we do things right, resolving this issue will come at the overhead of roughly an extra copy.todos
StreamGroup
for_each
closure return a future (T_T can't use nightly features here)map
methodfor_each
methodlimit
out into its own methodtry_for_each
to short-circuit on errorTry
family of traitscollect
methodFutureGroup
References