SUBSCRIBE

Syntax

  1. SUBSCRIBE channel [channel ...]

Time complexity: O(N) where N is the number of channels to subscribe to.

Subscribes the client to the specified channels.

Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, SSUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, SUNSUBSCRIBE, PUNSUBSCRIBE, PING, RESET and QUIT commands.

Examples

  1. user:1> SUBSCRIBE ab[c]
  2. ---
  3. dragonfly> PUBLISH abc message
  4. (integer) 0
  5. dragonfly> PUBLISH ab*c message
  6. (integer) 0
  7. dragonfly PUBLISH ab[c] message
  8. (integer) 1