-
Notifications
You must be signed in to change notification settings - Fork 18
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
Refactoring MQTT state management #88
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move a bunch of code down into ClientContext
, basically everything that doesn't need state()
or process_event()
. That frees you from having to unpack ClientContext
all the time and having to reaching down into it with context_mut()
so often. Instead in MqttClient
there'll be almost exclusively process_event()
and state()
and then a call
like context_mut().handle_something()
.
But otherwise good.
bc84e46
to
3c029d0
Compare
@jordens I elected to restructure it so that we only keep the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing. LGTM otherwise
This PR refactors the state management of the client to be entirely wrapped up in an
smlang::StateMachine
.This change is intended to support more complex state management that will be required to support all QoS levels.
This PR also removes public access to the
Minimq.client
object. It is now exposed viaMinimq::client()
to support compatibility going forward.