redisメッセージ購読

898 ワード

観察者モードを習ったことがありますか?
そんなもの
かっこの中のはパラメータです
コマンド:
subscribe [c1 (c2 ....)] 
#       ,      
unsubscribe [c1 (c2 ....)] 
#          
psubscribe [pattern1 (pattern2 ...)
#                   
#   h*llo  *       0     
# h?llo    ?         
# [ab]                 
punsubscribe [pattern1 (pattern2 ...)]
#            
publish [channel1 (channel2 ...)] [message]
#           
PUBSUB CHANNELS [pattern]
#   pattern            channels
#     patter,      

PUBSUB NUMSUB [channel-1 ... channel-N]
#                
#       channel,    list

PUBSUB NUMPAT
#           psubscribe patterns     

#      
#  http://www.redis.cn/commands/pubsub.html
  • は、複数のチャンネル
  • を一度に購読することができる.
  • 先購読後発行
  • あまり使われていないようです
    実際の作業ではメッセージ・ミドルウェアには使用されません