ousiax / goredis

Redis Go Client & Cluster
MIT License
1 stars 0 forks source link

Support PubSub feature #7

Open ousiax opened 8 years ago

ousiax commented 8 years ago

Support Pub/Sub feature

ousiax commented 8 years ago

@http://redis.io/topics/pubsub Client library implementation hints

Because all the messages received contain the original subscription causing the message delivery (the channel in the case of message type, and the original pattern in the case of pmessage type) client libraries may bind the original subscription to callbacks (that can be anonymous functions, blocks, function pointers), using an hash table.

When a message is received an O(1) lookup can be done in order to deliver the message to the registered callback.