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

Add option to allow usage of custom parser #121

Closed
wants to merge 1 commit into from
Closed

Add option to allow usage of custom parser #121

wants to merge 1 commit into from

Conversation

MasterOdin
Copy link
Contributor

@MasterOdin MasterOdin commented Dec 5, 2022

Sibling PR to socketio/socket.io-redis-adapter#471. This adds the same parser option here so that can plug in an alternative parser to encode messages to redis. See the other PR and its associated issue for more context.

One thing of note is that this is technically not BC due to modifying the broadcastOptions to require parser and that BroadcastOperator is exported, so if someone was importing it themselves for some reason, then they'd need to update their usage. However, I'm not sure how common a use case that is or how many people would be affected for this to warrant much concern. An alternative BC approach would be to make parser optional to broadcastOptions and then set it to the default within the constructor, but I rejected that approach initially just to keep the code as similar as it currently is.

@MasterOdin
Copy link
Contributor Author

@darrachequesne a friendly bump on this PR as I appreciate seeing socketio/socket.io-redis-adapter#471 be merged, I also need this one merged so I can use it in my own project. 😄

darrachequesne pushed a commit that referenced this pull request Jan 12, 2023
This PR adds a new parser option to the adapter constructor to allow
setting a custom parser to use, defaulting to using notepack.io. This
would allow someone to use a different msgpack library if they wanted,
or even an entirely different protocol altogether (e.g. protobuf).

Related: socketio/socket.io-redis-adapter@73f6320

Signed-off-by: Matthew Peveler <[email protected]>
@darrachequesne
Copy link
Member

Merged as 48bdd87 and included in version 5.1.0. Have a great day!

@darrachequesne darrachequesne added this to the 5.1.0 milestone Jan 12, 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