File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,21 @@ local redis server and send some requests:
13
13
14
14
$factory = new Factory($connector);
15
15
$factory->createClient()->then(function (Client $client) use ($loop) {
16
- $client->SET('greeting', 'Hello world');
17
- $client->APPEND('greeting', '!');
16
+ $api = new ResponseApi($client);
18
17
19
- $client->GET('greeting')->then(function ($greeting) {
18
+ $api->set('greeting', 'Hello world');
19
+ $api->append('greeting', '!');
20
+
21
+ $api->get('greeting')->then(function ($greeting) {
20
22
echo $greeting . PHP_EOL;
21
23
});
22
24
23
- $client->INCR ('invocation')->then(function ($n) {
25
+ $api->incr ('invocation')->then(function ($n) {
24
26
echo 'count: ' . $n . PHP_EOL;
25
27
});
26
28
27
29
// end connection once all pending requests have been resolved
28
- $client ->end();
30
+ $api ->end();
29
31
});
30
32
31
33
$loop->run();
You can’t perform that action at this time.
0 commit comments