Redis Publish コマンド

Redis パブリッシュ/サブスクライブ

Redis Publish コマンドは、指定したチャネルに情報を送信するために使用されます。

構文

redis Publish コマンドの基本構文は次のとおりです。

redis 127.0.0.1:6379> PUBLISH channel message

利用可能バージョン

>= 2.0.0

戻り値

情報を受信したサブスクライバーの数。

例

redis 127.0.0.1:6379> PUBLISH mychannel "hello, i m here"
(integer) 1

Redis パブリッシュ/サブスクライブ

その他の拡張