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

Optional Broker Shutdown #929

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

baxterjo
Copy link

@baxterjo baxterjo commented Dec 5, 2024

Type of change

New feature (non-breaking change which adds functionality)

Added non-breaking version of broker handle. This differs from #878 in two major ways:

  • Broker::start() will not return. This ensures applications that are already embedding the broker do not encounter any unexpected behavior when upgrading to the new version.
  • Broker uses cancellation tokens to facilitate cancellation. This ensures BrokerHandle's use is optional. Channel implementation will throw errors if the sender sides are dropped.

Added two unit tests for new functionality.

Also upgraded tokio-utils. Upgrade was necessary to use the CancellationToken::run_until_cancelled() method.

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.

@baxterjo baxterjo force-pushed the feature/rumqttd-shutdown branch 2 times, most recently from 27e1226 to 991341b Compare December 5, 2024 20:57
@baxterjo baxterjo force-pushed the feature/rumqttd-shutdown branch from 991341b to ddd0a46 Compare December 5, 2024 21:03
@baxterjo baxterjo changed the title Reworked PoC to not return from broker start. Optional Broker Shutdown Dec 5, 2024
Instead users must fetch handle before starting broker to ensure it is cancelable.
@baxterjo baxterjo force-pushed the feature/rumqttd-shutdown branch from ddd0a46 to 4c5218d Compare December 5, 2024 21:13
@baxterjo baxterjo mentioned this pull request Dec 9, 2024
2 tasks
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