[img]http://dl2.iteye.com/upload/attachment/0125/7808/d714ff91-f53c-3b84-a57f-6fc2adb9cc12.png[/img]
1 PSUBSCRIBE pattern [pattern ...]
订阅一个或多个符合给定模式的频道。
2 PUBSUB subcommand [argument [argument ...]]
查看订阅与发布系统状态。
3 PUBLISH channel message
将信息发送到指定的频道。
[img]http://dl2.iteye.com/upload/attachment/0125/7826/ab3da124-a9ac-3f7f-8431-4feb600db8f3.png[/img]
4 PUNSUBSCRIBE [pattern [pattern ...]]
退订所有给定模式的频道。
5 SUBSCRIBE channel [channel ...]
订阅给定的一个或多个频道的信息。
6 UNSUBSCRIBE [channel [channel ...]]
指退订给定的频道。
模拟下三个客户端,一个服务端发送服务,同时开始三个客户端,分别输入: subscribe testchannel
然后,再开一个客户端,publish testchannel "just for test ...."
如下图?:只要执行发布者客户端的channel,三个客户端会立马收到发布的信息
[img]http://dl2.iteye.com/upload/attachment/0125/7816/770a407d-487a-3bd0-b66f-cb3841edba94.png[/img]
1 PSUBSCRIBE pattern [pattern ...]
订阅一个或多个符合给定模式的频道。
2 PUBSUB subcommand [argument [argument ...]]
查看订阅与发布系统状态。
3 PUBLISH channel message
将信息发送到指定的频道。
[img]http://dl2.iteye.com/upload/attachment/0125/7826/ab3da124-a9ac-3f7f-8431-4feb600db8f3.png[/img]
4 PUNSUBSCRIBE [pattern [pattern ...]]
退订所有给定模式的频道。
5 SUBSCRIBE channel [channel ...]
订阅给定的一个或多个频道的信息。
6 UNSUBSCRIBE [channel [channel ...]]
指退订给定的频道。
模拟下三个客户端,一个服务端发送服务,同时开始三个客户端,分别输入: subscribe testchannel
然后,再开一个客户端,publish testchannel "just for test ...."
如下图?:只要执行发布者客户端的channel,三个客户端会立马收到发布的信息
[img]http://dl2.iteye.com/upload/attachment/0125/7816/770a407d-487a-3bd0-b66f-cb3841edba94.png[/img]