Skip to content

Commit a14bb1c

Browse files
committed
Update readme example to use new ReponseApi
1 parent 7d62bd5 commit a14bb1c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ local redis server and send some requests:
1313

1414
$factory = new Factory($connector);
1515
$factory->createClient()->then(function (Client $client) use ($loop) {
16-
$client->SET('greeting', 'Hello world');
17-
$client->APPEND('greeting', '!');
16+
$api = new ResponseApi($client);
1817

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) {
2022
echo $greeting . PHP_EOL;
2123
});
2224

23-
$client->INCR('invocation')->then(function ($n) {
25+
$api->incr('invocation')->then(function ($n) {
2426
echo 'count: ' . $n . PHP_EOL;
2527
});
2628

2729
// end connection once all pending requests have been resolved
28-
$client->end();
30+
$api->end();
2931
});
3032

3133
$loop->run();

0 commit comments

Comments
 (0)