new RedisClient(service, client)
Create Redis client
Parameters:
Name | Type | Description |
---|---|---|
service |
Redis | Redis service instance |
client |
object | Redis client instance |
Properties:
Name | Type | Default | Description |
---|---|---|---|
client |
object | Redis client | |
maxTransactionRetries |
number | 59 | Max number of transaction retries on serialization failures |
minTransactionDelay |
number | 100 | Minimum time to wait before retrying transaction |
maxTransactionDelay |
number | 1000 | Maximum time to wait before retrying transaction |
Methods
-
done()
-
Client termination
-
<async> query(command [, params])
-
Run Redis command
Parameters:
Name Type Argument Description command
string Command params
Array <optional>
Command parameters Returns:
Resolves to command reply- Type
- Promise
-
<async> transaction( [params], cb)
-
Run a transaction
Parameters:
Name Type Argument Description params
object <optional>
Properties
Name Type Argument Description name
string <optional>
Transaction name for debugging watch
Array.<string> <optional>
Watched Redis keys cb
RedisTransaction The transaction function Returns:
Resolves to an array of two items: transaction result and queue exec replies array- Type
- Promise