Skip to content

Commit 09d7814

Browse files
committed
Simplify usage by supporting new Socket API
1 parent d3e55bc commit 09d7814

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ Once [installed](#install), you can use the following code to connect to your
6060
local Redis server and send some requests:
6161

6262
```php
63+
<?php
64+
65+
require __DIR__ . '/vendor/autoload.php';
66+
6367
$factory = new Clue\React\Redis\Factory();
6468

6569
$client = $factory->createLazyClient('localhost');
@@ -101,7 +105,7 @@ If you need custom DNS, proxy or TLS settings, you can explicitly pass a
101105
custom instance of the [`ConnectorInterface`](https://github.com/reactphp/socket#connectorinterface):
102106

103107
```php
104-
$connector = new React\Socket\Connector(null, array(
108+
$connector = new React\Socket\Connector(array(
105109
'dns' => '127.0.0.1',
106110
'tcp' => array(
107111
'bindto' => '192.168.10.1:0'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"react/event-loop": "^1.2",
1818
"react/promise": "^2.0 || ^1.1",
1919
"react/promise-timer": "^1.5",
20-
"react/socket": "^1.8"
20+
"react/socket": "^1.9"
2121
},
2222
"require-dev": {
2323
"clue/block-react": "^1.1",

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Factory
3131
public function __construct(LoopInterface $loop = null, ConnectorInterface $connector = null, ProtocolFactory $protocol = null)
3232
{
3333
$this->loop = $loop ?: Loop::get();
34-
$this->connector = $connector ?: new Connector($this->loop);
34+
$this->connector = $connector ?: new Connector(array(), $this->loop);
3535
$this->protocol = $protocol ?: new ProtocolFactory();
3636
}
3737

0 commit comments

Comments
 (0)