pipeline.php 396 B

12345678910111213141516171819
  1. <?php
  2. const REDIS_SERVER_HOST = 'host.docker.internal';
  3. const REDIS_SERVER_PORT = 6379;
  4. go(function () {
  5. $redis = new Swoole\Coroutine\Redis();
  6. $redis->connect(REDIS_SERVER_HOST, REDIS_SERVER_PORT);
  7. $redis->setDefer();
  8. $redis->set('key1', 'value');
  9. $redis->get('key1');
  10. $result1 = $redis->recv();
  11. $result2 = $redis->recv();
  12. var_dump($result1, $result2);
  13. });