Skip to content

Commit 34e2368

Browse files
committed
Rename Driver to Client
1 parent 6146a38 commit 34e2368

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $videoQueue = new Queue(
4747
'videoQueue',
4848
new QueueOpts([
4949
'redis' => new RedisConfig([
50-
'driver' => 'predis',
50+
'client' => 'predis',
5151
'host' => '127.0.0.1',
5252
'port' => 6379,
5353
'password' => '',
@@ -70,7 +70,7 @@ All is configured via classes:
7070
* `Ilzrv\PhpBullQueue\DTOs\JobOpts`
7171

7272
### RedisConfig
73-
* `driver` (string) Redis driver. Can be `phpredis` or `predis`. Default: `phpredis`
73+
* `client` (string) Redis client. Can be `phpredis` or `predis`. Default: `phpredis`
7474
* `host` (string) Redis host. Default: `127.0.0.1`
7575
* `port` (int) Redis port. Default: `6379`
7676
* `password` (string) Redis password. Default: `''`

src/Drivers/PhpRedisQueue.php renamed to src/Clients/PhpRedisQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Ilzrv\PhpBullQueue\Drivers;
5+
namespace Ilzrv\PhpBullQueue\Clients;
66

77
use Ilzrv\PhpBullQueue\DTOs\RedisConfig;
88
use Redis;

src/Drivers/PredisQueue.php renamed to src/Clients/PredisQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Ilzrv\PhpBullQueue\Drivers;
5+
namespace Ilzrv\PhpBullQueue\Clients;
66

77
use Ilzrv\PhpBullQueue\DTOs\RedisConfig;
88
use Predis\Client as Redis;

src/Drivers/RedisQueue.php renamed to src/Clients/RedisQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Ilzrv\PhpBullQueue\Drivers;
5+
namespace Ilzrv\PhpBullQueue\Clients;
66

77
interface RedisQueue
88
{

src/DTOs/RedisConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class RedisConfig extends DataTransferObject
88
{
9-
public string $driver = 'phpredis';
9+
public string $client = 'phpredis';
1010
public string $host = '127.0.0.1';
1111
public int $port = 6379;
1212
public string $password = '';

src/Queue.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Ilzrv\PhpBullQueue;
66

7-
use Ilzrv\PhpBullQueue\Drivers\PhpRedisQueue;
8-
use Ilzrv\PhpBullQueue\Drivers\PredisQueue;
9-
use Ilzrv\PhpBullQueue\Drivers\RedisQueue;
7+
use Ilzrv\PhpBullQueue\Clients\PhpRedisQueue;
8+
use Ilzrv\PhpBullQueue\Clients\PredisQueue;
9+
use Ilzrv\PhpBullQueue\Clients\RedisQueue;
1010
use Ilzrv\PhpBullQueue\DTOs\JobOpts;
1111
use Ilzrv\PhpBullQueue\DTOs\QueueOpts;
1212
use Ramsey\Uuid\Uuid;
@@ -42,7 +42,7 @@ public function add(string $name, array $data, JobOpts $opts = null)
4242

4343
$prefix = sprintf('%s:%s:', $this->opts->prefix, $this->name);
4444

45-
return $this->queue()->add(
45+
return $this->client()->add(
4646
LuaScripts::add(),
4747
[
4848
$prefix.'wait',
@@ -70,15 +70,15 @@ public function add(string $name, array $data, JobOpts $opts = null)
7070
/**
7171
* @return RedisQueue
7272
*/
73-
protected function queue()
73+
protected function client()
7474
{
75-
switch ($this->opts->redis->driver) {
75+
switch ($this->opts->redis->client) {
7676
case 'predis':
7777
return new PredisQueue($this->opts->redis);
7878
case 'phpredis':
7979
return new PhpRedisQueue($this->opts->redis);
8080
default:
81-
throw new RuntimeException("{$this->opts->redis->driver} driver is not supported.");
81+
throw new RuntimeException("{$this->opts->redis->client} client is not supported.");
8282
}
8383
}
8484
}

0 commit comments

Comments
 (0)