-
Notifications
You must be signed in to change notification settings - Fork 156
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
Warning misbehaving underlying sources #298
Comments
I think we should. Here are the cases I can think of:
I will do a quick PR to fix this. It seems likely just an oversight so far. |
Oh, hmm, what if the stream was cancelled by |
OK. So, shall we warn the source only if close()-ed when it's already draining? |
Re: error, It seems we don't have any path to notify the underlying source of that the
Hmm, though (1) means that the source cannot avoid bad Re: close, Hmm, maybe that's the only place where unsolicited close() happens? So, ok, the consumer is no longer interested in data, and the underlying source has finished work. Sounds like it's ok to just make I.e. throw only when draining. |
I think your analysis makes sense. Should we allow double-close when not draining, even if both of them were underlying-source initiated? Or should we try to disallow double-close() in that case? (The only way to make that work I think is to add another flag, or maybe another state which we treat very much like closed. So that's kind of annoying. But it seems also weird that if the queue has chunks in it, |
Ah, I see. |
Oh I see, that should work pretty well, nice :) |
(Branched from #296 (comment))
Should we throw if an underlying source looks misbehaving?
Example: Underlying source calling close function provided by the stream twice or more
The text was updated successfully, but these errors were encountered: