Skip to content
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

Add OnSessionEstablish hook #247

Conversation

dgduncan
Copy link
Collaborator

This PR adds the OnSessionEstablish hook. The reasoning behind this addition is to begin to add functionality that will enable future "cluster" mode work. I.E this allows the server an opportunity to check for client data on a remote store and pull in that client before going through before inheriting the session or creating a new client session.

This would allow for a different type of persistence topology where clients are imported on a per client connection basis and not a "big bang" import as is current done in the current persistence implementations. The current topology works well for a single server type design and not a multi server or multi node type design.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5371431056

  • 8 of 8 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 98.627%

Totals Coverage Status
Change from base Build 5310181217: 0.002%
Covered Lines: 5243
Relevant Lines: 5316

💛 - Coveralls

@mochi-co
Copy link
Collaborator

mochi-co commented Jul 8, 2023

This looks good to me, I'll add it to the next release! Sorry for the delay in reviewing!

@mochi-co mochi-co merged commit fe0c1d1 into mochi-mqtt:master Jul 8, 2023
@mochi-co
Copy link
Collaborator

mochi-co commented Jul 8, 2023

this allows the server an opportunity to check for client data on a remote store and pull in that client before going through before inheriting the session or creating a new client session.

It may be interesting to migrate to this model entirely instead of loading all clients at the beginning. I can't think of many situations where this wouldn't be a superior pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants