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

Refactor pubusb to allow subscribing and unsubscribing from another thread #1131

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

casperisfine
Copy link

redis-rb's pubsub always has been very hard to work with, because once you
are subscribed, you can no longer manage the subscription outside of
the various callback.

But the SUBSCRIBE family of command returns no response, and the
subscribed client only reads the socket. So we can actually send
SUBSCRIBE style of commands from another thread.

@casperisfine casperisfine force-pushed the unsubscribe-lock branch 3 times, most recently from 8abde03 to 73dc8e2 Compare August 19, 2022 10:04
…hread

redis-rb pubsub always has been very hard to work with, because once you
are subscribed, you can no longer manage the subscription outside of
the various callback.

But the `SUBSCRIBE` family of command returns no response, and the
subscribed client only reads the socket. So we can actually send
`SUBSCRIBE` style of commands from another thread.
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