Redis::psubscribe PHP Method

psubscribe() public static method

Subscribe to a set of given channels with wildcards.
public static psubscribe ( array | string $channels, Closure $callback, string $connection = null ) : void
$channels array | string
$callback Closure
$connection string
return void
        public static function psubscribe($channels, $callback, $connection = null)
        {
            \Illuminate\Redis\Database::psubscribe($channels, $callback, $connection);
        }

Usage Example

<?php

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$channel = $argv[1];
// channel
$redis->psubscribe(array('channel' . $channel), 'callback');
function callback($instance, $channelName, $message)
{
    echo $channelName, "==>", $message, PHP_EOL;
}
All Usage Examples Of Redis::psubscribe