Methods
batch(commands, onSend) → {Redis}
Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other
client users.
Parameters:
| Name | Type | Description |
|---|---|---|
commands |
Array.<Request> | list of command to send |
onSend |
function | the asynchronous result handler. |
- Source:
Returns:
fluent self.
- Type
- Redis
close()
- Source:
connect(handler) → {Redis}
Connects to the redis server.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function | the async result handler |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
endHandler(endHandler) → {Redis}
Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
exceptionHandler(handler) → {Redis}
Set an exception handler on the read stream.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function | the exception handler |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
fetch(amount) → {Redis}
Fetch the specified
amount of elements. If the ReadStream has been paused, reading will
recommence with the specified amount of items, otherwise the specified amount will
be added to the current stream demand.
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
handler(handler) → {Redis}
Set a data handler. As data is read, the handler will be called with the data.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
pause() → {Redis}
Pause the
ReadStream, it sets the buffer in fetch mode and clears the actual demand.
While it's paused, no data will be sent to the data handler.
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
pipe() → {Pipe}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a
WriteStream.
- Source:
Returns:
a pipe
- Type
- Pipe
pipeTo(dst, handler)
Pipe this
ReadStream to the WriteStream.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler will be
called with the result.
Parameters:
| Name | Type | Description |
|---|---|---|
dst |
WriteStream | the destination write stream |
handler |
function |
- Source:
resume() → {Redis}
Resume reading, and sets the buffer in
flowing mode.
If the ReadStream has been paused, reading will recommence on it.
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- Redis
send(command, onSend) → {Redis}
Send the given command to the redis server or cluster.
Parameters:
| Name | Type | Description |
|---|---|---|
command |
Request | the command to send |
onSend |
function | the asynchronous result handler. |
- Source:
Returns:
fluent self.
- Type
- Redis
socketAddress() → {string}
Returns the address associated with this client.
- Source:
Returns:
the address.
- Type
- string