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

Client write buffers #165

Merged
merged 3 commits into from
Feb 9, 2023
Merged

Client write buffers #165

merged 3 commits into from
Feb 9, 2023

Conversation

mochi-co
Copy link
Collaborator

@mochi-co mochi-co commented Feb 9, 2023

Following our discussion in #150 and #160

This PR removes the fixed pool in exchange for writing directly to the clients via client-specific buffered write channels. In the event that a client's write buffer is full, in such an event as a slow reading client, the message is dropped and the new OnPublishDropped hook is called. If the message was QoS 1 or 2, the inflight is rolled back and the message is treated as unattempted.

Also corrects tests and updates benchmarks. Paho is passing.

cc @thedevop thank you for your insights! If you could take a look and see if this PR is appropriate, I would be very grateful :) My apologies for the delay!

@coveralls
Copy link

coveralls commented Feb 9, 2023

Pull Request Test Coverage Report for Build 4138174316

  • 45 of 46 (97.83%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.08%) to 98.587%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server.go 22 23 95.65%
Files with Coverage Reduction New Missed Lines %
server.go 3 99.62%
Totals Coverage Status
Change from base Build 4137585804: -0.08%
Covered Lines: 5094
Relevant Lines: 5167

💛 - Coveralls

Copy link
Collaborator

@thedevop thedevop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one inherited bug that's not related to this change.

clients.go Show resolved Hide resolved
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.

None yet

3 participants