-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support for pub-sub #48
Comments
hi i added the pub-sub support. but there is one thing you have to open 2 redis connection 1 will listen for subscribe (redis messages) and other is used to do command to redis. |
but in the main.swift you need to make changes as per your requirements. |
@surendratiwari3 Can you please provide an example on how to use your implementation? |
do {
} catch { |
please declare the client and client1 like this: let client = try Redbird() let client1 = try Redbird() |
Thanks @surendratiwari3 , got it working. Great job !! |
will you please do the same comment in the my pull request so they will accept it. and also please endorse me on linkledin . https://www.linkedin.com/in/surendra-tiwari-ab569a15?trk=nav_responsive_tab_profile |
I'm looking to dynamically change the list of topics that my pubsub connection subscribes to. It appears that the current Redbird code only lets me subscribe to one topic and then blocks. Is there any way to allow me to send additional commands (subscribe/unsubscribe) while I am listening for messages using Redbird? |
yeah i provided a way to achieve that just take my pull request and enjoy! |
Added in #56 |
Apologies if I missed something, but it seems like pub-sub is currently not supported? From what I see, when calling
command
, it does both a write and a read of the response on the socket, and there's no finer-grained method to just emit a write and a separate one for the reads, which are required for pub-sub (you call[P]SUBSCRIBE
with a write, and then wait for messages by reading on the socket - it typically can't be used for other writes except to subscribe/unsubscribe to/from other channels).For example, the redigo package in Go has separate Send/Flush calls to write, and Receive to read, and a convenience Do method that combines them for the common commands that immediately return a value (https://godoc.org/github.com/garyburd/redigo/redis#Conn). It also provides a PubSubConn type as convenience, built from the Send/Flush/Receive primitives (https://godoc.org/github.com/garyburd/redigo/redis#PubSubConn).
The text was updated successfully, but these errors were encountered: