Skip to content

Shared subscriptions with configurable strategy#668

Merged
swanandx merged 27 commits intobytebeamio:mainfrom
Nickztar:new-shared-subs
Aug 15, 2023
Merged

Shared subscriptions with configurable strategy#668
swanandx merged 27 commits intobytebeamio:mainfrom
Nickztar:new-shared-subs

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

LGTM! great work @Nickztar & @swanandx 🚀

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