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

feat: expose EventLoop::clean #741

Merged
merged 4 commits into from
Nov 1, 2023
Merged

feat: expose EventLoop::clean #741

merged 4 commits into from
Nov 1, 2023

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented Oct 31, 2023

Type of change

Make public the EventLoop::clean method to allow for storage of pending requests onto disk in bytebeamio/uplink

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if it's relevant to the users of the library. If it's not relevant mention why.

Copy link
Member

@swanandx swanandx left a comment

Choose a reason for hiding this comment

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

Please also copy this changes in v5/eventloop.rs so we stay consistent with the API

PS: what is the benefit or in which situations would someone call clean()? If user wants to disconnect client, they can just call client.disconnect() and it would call the clean() method internally. That would be much more cleaner right? does is has something to do with who closes the network connection first?

rumqttc/src/eventloop.rs Outdated Show resolved Hide resolved
@de-sh
Copy link
Contributor Author

de-sh commented Nov 1, 2023

what is the benefit or in which situations would someone call clean()? If user wants to disconnect client, they can just call client.disconnect() and it would call the clean() method internally. That would be much more cleaner right? does is has something to do with who closes the network connection first?

This is to solve for the problem that we might end up dealing with when eventloop is blocked on handling inflight because of bad network and that is leading to us not being able to disconnect as the request waits for the channel to recv. So just a fail-safe to ensure we can save pending packets onto disk and they aren't lost because of the possible situation I have mentioned.

@swanandx swanandx merged commit 0aa4ac3 into main Nov 1, 2023
3 checks passed
@swanandx swanandx deleted the expose-clean branch November 1, 2023 03:57
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.

2 participants