-
Notifications
You must be signed in to change notification settings - Fork 255
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
rumqttc: ConnectionError::RequestsDone
is unreachable
#815
Comments
Going by how other libraries handle this, I think we should deprecate |
From an even higher perspective I don't get why there's a separation between Why not: AsyncClient::new(opt) -> AsyncClient;
impl Stream<Item = Result<Event, ConnectionError> for AsyncClient { ... }
impl Sink<Request, Error = ConnectionError> for AsyncClient { ... } I see the following advantages:
The If the separation is needed there's StreamExt::split |
The initial design was simple, an eventloop, that gets driven by calls to |
The async v5 client implementation checks for errors when receiving from the request channel. The only error that can happen here (with flume) is RecvError (disconnected):
An error that may be emitted when attempting to wait for a value on a receiver when all senders are dropped and there are no more messages in the channel.
.EventLoop holds a sender handle to this channel. This error condition can never happen. The implementation is confusing.
During the construction of the
AsyncClient
the tx handle is cloned.A easy fix could be to return the sending half from
EventLoop::new
(and update the visibility) and move it into theAsyncClient
:The text was updated successfully, but these errors were encountered: