From 818a59c19655ca536513c8624f92e80e6d8f2455 Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 2 Nov 2022 15:36:04 +0200 Subject: [PATCH] readme fixes --- README.md | 8 ++++---- src/Queue/Connection/Redis.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b95f036..4ab26cc 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,11 @@ use Utopia\Queue; use Utopia\Queue\Message; $connection = new Queue\Connection\Redis('redis'); -$adapter = new Queue\Adapter\Swoole($connection, 12, 'swoole'); +$adapter = new Queue\Adapter\Swoole($connection, 12, 'my-queue'); $server = new Queue\Server($adapter); -$server->job() +$server + ->job() ->inject('message') ->action(function (Message $message) { var_dump($message); @@ -55,8 +56,7 @@ $server->start(); // Enqueue messages to the worker using the Redis adapter $connection = new Redis('redis', 6379); -$client = new Client('swoole', $connection); -$client->resetStats(); +$client = new Client('my-queue', $connection); $client->enqueue([ 'type' => 'test_number', diff --git a/src/Queue/Connection/Redis.php b/src/Queue/Connection/Redis.php index 3075bba..93792b0 100644 --- a/src/Queue/Connection/Redis.php +++ b/src/Queue/Connection/Redis.php @@ -169,6 +169,6 @@ protected function getRedis(): \Redis $this->redis->connect($this->host, $this->port); - return $this->getRedis(); + return $this->redis; } }