Skip to content

Commit

Permalink
Updated to use lazy client and always have a working one available
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Mar 11, 2019
1 parent ba49fc5 commit 6127058
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 299 deletions.
3 changes: 1 addition & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use PhpCsFixer\Config;
return (function (): Config
{
$paths = [
__DIR__ . DIRECTORY_SEPARATOR . 'src',
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
__DIR__ . DIRECTORY_SEPARATOR . 'etc',
];

return PhpCsFixerConfig::create()
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"description": "PHP-DI definition for clue/redis-react",
"require": {
"php": "^7.2",
"clue/redis-react": "^2.2",
"psr/log": "^1.0",
"wyrihaximus/psr-3-callable-throwable-logger": "^1.0"
"clue/redis-react": "^2.3"
},
"require-dev": {
"api-clients/test-utilities": "^5.1"
Expand Down
165 changes: 61 additions & 104 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions etc/di/redis-client.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
<?php declare(strict_types=1);

use Clue\React\Redis\Client;
use PHPDIDefinitions\Clue\Redis\Client\WaitingClient;
use Psr\Log\LoggerInterface;
use Clue\React\Redis\Factory;
use React\EventLoop\LoopInterface;

return [
Client::class => \DI\factory(function (LoopInterface $loop, string $dsn, LoggerInterface $logger = null) {
return WaitingClient::create($loop, $dsn, $logger);
Client::class => \DI\factory(function (LoopInterface $loop, string $dsn) {
return (new Factory($loop))->createLazyClient($dsn);
})
->parameter('dsn', \DI\get('config.redis.dsn')),
];
86 changes: 0 additions & 86 deletions src/WaitingClient.php

This file was deleted.

30 changes: 0 additions & 30 deletions tests/RedisClient.php

This file was deleted.

Loading

0 comments on commit 6127058

Please sign in to comment.