-
Notifications
You must be signed in to change notification settings - Fork 5
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
Propose Session trait and remove all the logic below the application-layer #20
Conversation
MQTT is defined on top of the applicaiton-layer and all that it requires is an active session. We can simplify the logic by assuming a user has performed connection to a broker in advance and supplies the session. It is nice and kind of the `rumqtt` client implementation where it takes care of all the TLS connection building, like CA and certs. However it is only possible because of `tokio_tls` and not the case for embedded environment.
Although it look pedantic I propose a session trait encapsulating network transaction in general. One downside of the `TcpClient` trait is that it only allows a single socket type. On the other hand, the `Session` trait can be implemented by multiple transaction types and they can share the same driver type of `TcpClient`.
I will get to reviewing this and your other PRs, but at the moment i have gotten STRICT orders from Finn, not to add ANY new code, until we have fully verified that the connection state handling is as good as it needs to be. Thus i am pushing the reviews until they are applicable. They do look sound at first sight though. 👍 |
Fully understood. For the time being we should focus on testing existing code base. Thanks for your comment :) |
@keisrk Could you rebase this, so i can test it out? |
2444b8d
to
369237b
Compare
Although it looks pedantic I propose a session trait encapsulating network
transaction in general. One downside of the
TcpClient
trait is that it onlyallows a single socket type. The
Session
trait is meant to be implemented bymultiple transaction types and they can share the same driver type of
TcpClient
.MQTT is defined on top of the applicaiton-layer and all that it requires is an
active session. We can simplify the logic by assuming a user has performed
connection to a broker in advance and supplies the session only.
It is nice and kind of the
rumqtt
client implementation where it takes care ofall the TLS connection building, like CA and certs. However it is only possible
because of
tokio_tls
and not the case for our embedded environment.