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
Semantics of stream read yielding None
and Some(Err)
?
#200
Comments
Ok(None)
and Err(e)
?None
and Some(Err)
?
So the thing is that every stream must eventually end. Like every iterator, when the iterator ends, it returns This also means that if the connection is ended gracefully on either of the sides, we don't really want to return any error, but "gracefully" close the stream (by returning However sometimes there are cases when the connection is closed because of some error like protocol violation. We don't really want to just turn these into |
Yes that clears everything up neatly, thank you.
Is this in the documentation? I suspect other people will also not intuit the subtlety, and I think it's important for consumers to understand exactly what conditions they are really handling. |
So the As for the internal |
If |
Ok, it makes sense, submitted a PR to address it. |
Use Autobahn Suite from Docker, symmetrical to snapview#165
I am confused on some of the semantics surrounding streams
yielding
Option<Result<...>>
intokio-tungsteninte
.Let's say I have a setup like this:
I have witnessed streams yield
Some(Err(Protocol(...)))
andNone
(I think separately).read.next().await
yieldsNone
? I want to know what this means must have happened.Protocol
error – seemingly fatal) and not be ended (by aNone
)? Is this just an artifact of the stream abstraction / type design?Thanks so much,
I really enjoy using your library in my daily work, I hope you can help me with my question.
The text was updated successfully, but these errors were encountered: