Skip to content

Commit 7e782ce

Browse files
committed
Documentation for Client
1 parent dcd3e43 commit 7e782ce

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Client.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,33 @@
33
namespace Clue\React\Redis;
44

55
use Evenement\EventEmitterInterface;
6+
use React\Promise\PromiseInterface;
7+
use Clue\Redis\Protocol\Model\ModelInterface;
68

9+
/**
10+
* Simple interface for executing redis commands
11+
*
12+
* @event message(ModelInterface $model, Client $thisClient)
13+
*/
714
interface Client extends EventEmitterInterface
815
{
16+
/**
17+
* Invoke the given command and return a Promise that will be resolved when the request has been replied to
18+
*
19+
* This is a magic method that will be invoked when calling any redis
20+
* command on this instance.
21+
*
22+
* @param string $name
23+
* @param string[] $args
24+
* @return PromiseInterface
25+
*/
926
public function __call($name, $args);
1027

28+
/**
29+
* Checks if the client is busy, i.e. still has any requests pending
30+
*
31+
* @return boolean
32+
*/
1133
public function isBusy();
1234

1335
/**
@@ -18,5 +40,10 @@ public function isBusy();
1840
*/
1941
public function end();
2042

43+
/**
44+
* close connection immediately
45+
*
46+
* @see self::end() for closing the connection once the client is idle
47+
*/
2148
public function close();
2249
}

0 commit comments

Comments
 (0)