-
Notifications
You must be signed in to change notification settings - Fork 653
Revisit choice for channel senders to use Result
#225
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
Comments
Yeah I'd kinda prefer to not send results as well, but do we have another error type for the channel? Oneshots have a concrete error type of "disconnected", but for streams that's done through ending the stream. Of course it's possible that we could say that the error type is just never generated... (e.g. it's just a generic w/ a phantomdata) |
Right, or |
I'd feel kinda bad going to In the meantime I feel like it's better to make use of the error type and send results than to hardwire it to a generic or |
That doesn't really make sense to me. Just because the error type is there doesn't mean we have to use it, and the Note that we have plenty of examples of unused errors: consider I do agree that making it generic over the error is going to be a pain, but we can provide a |
This probably relates to #206 |
Another related issue: the choice of |
IMO, the error type of the stream should be used to indicate a scenario where the stream was terminated abruptly due to an error condition. In some cases, it may be that it is impossible for a stream to terminate abruptly, in which case |
Ok well I saw at least one location where we may want |
And yes this is related to #206 and yes |
SPSC is removed, MPSC includes this change, and the old channels are deprecated, so closing. |
The fact that senders use
Result
has always struck me as a bit odd, and with the introduction ofSink
, makes channels somewhat finicky to compose. I'd like to revisit whether this is the right choice to bake in by default, vs requiring a "flattening" transformation in the cases where you do want to useResult
.(Another, more minor strike against this choice is the inconsistency with
oneshot
, which is on its way to being more of a channel-like abstraction.)The text was updated successfully, but these errors were encountered: