public function index() { $client = new \swoole_redis(); $client->on('message', function (\swoole_redis $client, $result) { print_r($result); }); $client->connect('127.0.0.1', 6379, function (\swoole_redis $client, $result) { echo "connect\n"; $client->psubscribe('__key*__:*'); }); }