Skip to content

feat: expose EventLoop::clean#741

Merged
swanandx merged 4 commits intomainfrom
expose-clean
Nov 1, 2023
Merged

feat: expose EventLoop::clean#741
swanandx merged 4 commits intomainfrom
expose-clean

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
Contributor

@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?

@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
@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