<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/17 0017
 * Time: 下午 2:29
 */
require APPLICATION_PATH . '/scripts/crontab/common.php';
$conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName');
$redis=new Redis();
$redis->connect($conf['host'], $conf['port']);
if(!empty($conf['password'])){
    $redis->auth($conf['password']);
}
//ini_set('default_socket_timeout', -1);(所有长连接不超时)
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
$result=$redis->subscribe(array($redisPublishName), array($this,'callback'));