我必须发布“测试”频道并收听“ mytesting()”,但是发布成功完成。但是在订阅时,mytesting()未执行。
public function test()
{
$this->redis_connection();
$this->redis->publish('testing',"hi");
try
{
$success=$this->redis->subscribe('testing','mytesting');
print_r($success);
}catch(Exception $e)
{
print_r($e->getMessage());
}
}
public function mytesting($reds, $chan, $stdout)
{
return $chan;
}