Latest web development tutorials

Redisのコマンドを購読

Redisのパブリッシュおよびサブスクライブ

Redisのは、1つまたは複数のチャネルのために与えられたコマンド情報を購読購読します。 。

文法

Redisのは、次のように基本的なコマンドの構文は次のとおりです登録します:

redis 127.0.0.1:6379> SUBSCRIBE channel [channel ...]

利用可能なバージョン

> = 2.0.0

戻り値

受信した情報

redis 127.0.0.1:6379> SUBSCRIBE mychannel 
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "mychannel"
3) (integer) 1
1) "message"
2) "mychannel"
3) "a"

Redisのパブリッシュおよびサブスクライブ