Skip to content

Commit 6127058

Browse files
committed
Updated to use lazy client and always have a working one available
1 parent ba49fc5 commit 6127058

File tree

7 files changed

+67
-299
lines changed

7 files changed

+67
-299
lines changed

.php_cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ use PhpCsFixer\Config;
66
return (function (): Config
77
{
88
$paths = [
9-
__DIR__ . DIRECTORY_SEPARATOR . 'src',
10-
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
9+
__DIR__ . DIRECTORY_SEPARATOR . 'etc',
1110
];
1211

1312
return PhpCsFixerConfig::create()

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"description": "PHP-DI definition for clue/redis-react",
55
"require": {
66
"php": "^7.2",
7-
"clue/redis-react": "^2.2",
8-
"psr/log": "^1.0",
9-
"wyrihaximus/psr-3-callable-throwable-logger": "^1.0"
7+
"clue/redis-react": "^2.3"
108
},
119
"require-dev": {
1210
"api-clients/test-utilities": "^5.1"

composer.lock

Lines changed: 61 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/di/redis-client.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
use Clue\React\Redis\Client;
4-
use PHPDIDefinitions\Clue\Redis\Client\WaitingClient;
5-
use Psr\Log\LoggerInterface;
4+
use Clue\React\Redis\Factory;
65
use React\EventLoop\LoopInterface;
76

87
return [
9-
Client::class => \DI\factory(function (LoopInterface $loop, string $dsn, LoggerInterface $logger = null) {
10-
return WaitingClient::create($loop, $dsn, $logger);
8+
Client::class => \DI\factory(function (LoopInterface $loop, string $dsn) {
9+
return (new Factory($loop))->createLazyClient($dsn);
1110
})
1211
->parameter('dsn', \DI\get('config.redis.dsn')),
1312
];

src/WaitingClient.php

Lines changed: 0 additions & 86 deletions
This file was deleted.

tests/RedisClient.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)