Pub/Sub发布订阅(三)

2015-07-24 06:57:32 · 作者: · 浏览: 6
r high performance web chat.
Pieter Noordhuis使用redis的EventMachine创建了一个多用户的高性能网络聊天 系统

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.

使用hash table 注册订阅通道与回调函数关联,当收到订阅通道消息时直接调用注册的函数处理。