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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared subscriptions with configurable strategy #668

Merged
merged 27 commits into from Aug 15, 2023

Conversation

Nickztar
Copy link
Contributor

@Nickztar Nickztar commented Jul 30, 2023

This PR adds support for shared subscriptions. This PR adds support for shared subscriptions in broker with the ability to use multiple strategies for it. The available strategies are as follows:

  • round_robin (Default): In order of subscription, moving from first to last to first etc.
  • random: Random selection among all subscribers, using rand crate to select a random client.
  • sticky: Always send to the last selected subscriber, only moving when a client is no longer available.

Strategies are specified in the router config and by default commented but easily changeable.

This PR supersedes #628 and was made by me and @swanandx. 馃憤馃徏

Type of change

New feature (non-breaking change which adds functionality)

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if its relevant of user of the library. If its 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.

LGTM! great work @Nickztar & @swanandx 馃殌

@swanandx swanandx merged commit 1963b3e into bytebeamio:main Aug 15, 2023
3 checks passed
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

2 participants