Commit 2f520aea authored by chenchuanwen's avatar chenchuanwen

redispush

parent f240cf42
<?php <?php
/** /**
* 推送10秒推送一次 *
* 推送10秒推送一次 * 推送10秒推送一次
* *
* @author chenjiebin <sjlinyu@qq.com> * @author chenjiebin <sjlinyu@qq.com>
...@@ -17,9 +17,11 @@ $redis->connect($conf['host'], $conf['port']); ...@@ -17,9 +17,11 @@ $redis->connect($conf['host'], $conf['port']);
if(!empty($conf['password'])){ if(!empty($conf['password'])){
$redis->auth($conf['password']); $redis->auth($conf['password']);
} }
$result=$redis->subscribe(array('pushcenter'), 'callback'); //ini_set('default_socket_timeout', -1);(所有长连接不超时)
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
$result=$redis->subscribe(array('redisPublish'), 'callback');
function printTest($meg){ function printTest($meg){
echo $meg; echo $meg.'213';
} }
function callback($instance,$channelName,$message){ function callback($instance,$channelName,$message){
printTest($message); printTest($message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment