Skip to content

Commit 8f1c9bb

Browse files
committed
Better documentation for Promises
1 parent f0f1a26 commit 8f1c9bb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ It enables you to set and query its data or use its PubSub topics to react to in
2929
* [createClient()](#createclient)
3030
* [Client](#client)
3131
* [Commands](#commands)
32-
* [Processing](#processing)
32+
* [Promises](#promises)
3333
* [on()](#on)
3434
* [close()](#close)
3535
* [end()](#end)
@@ -113,7 +113,7 @@ and keeps track of pending commands.
113113

114114
#### Commands
115115

116-
All [Redis commands](http://redis.io/commands) are automatically available as public methods (via the magic `__call()` method) like this:
116+
All [Redis commands](http://redis.io/commands) are automatically available as public methods like this:
117117

118118
```php
119119
$client->get($key);
@@ -135,11 +135,17 @@ $client->select($database);
135135
```
136136

137137
Listing all available commands is out of scope here, please refer to the [Redis command reference](http://redis.io/commands).
138+
All [Redis commands](http://redis.io/commands) are automatically available as public methods via the magic `__call()` method.
138139

139-
#### Processing
140+
Each of these commands supports async operation and either *resolves* with
141+
its *results* or *rejects* with an `Exception`.
142+
Please see the following section about [promises](#promises) for more details.
143+
144+
#### Promises
140145

141146
Sending commands is async (non-blocking), so you can actually send multiple commands in parallel.
142147
Redis will respond to each command request with a response message, pending commands will be pipelined automatically.
148+
143149
Sending commands uses a [Promise](https://github.com/reactphp/promise)-based interface that makes it easy to react to when a command is *fulfilled*
144150
(i.e. either successfully resolved or rejected with an error):
145151

0 commit comments

Comments
 (0)