Redis

A simple Redis client.

package

Default

Methods

__construct

__construct() 

Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.

batch( $arg0,  $arg1) : $this

Arguments

$arg0

array

$arg1

callable

Response

$this

fluent self.

close

close() : void

Connects to the redis server.

connect( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Connect to redis, the <code>onConnect</code> will get the @see \io\vertx\jphp\redis\client\Redis instance.

createClient( $arg0,  $arg1) : \io\vertx\jphp\redis\client\Redis
static

This connection will use the default options which are connect to a standalone server on the default port on "localhost".

param $vertx [Vertx] param $address [string] createClient($vertx, $address)

Connect to redis, the onConnect will get the @see \io\vertx\jphp\redis\client\Redis instance.

param $vertx [Vertx] param $options [array] createClient($vertx, $options)

Arguments

$arg0

Vertx

$arg1

string | array

Response

\io\vertx\jphp\redis\client\Redis

Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.

endHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Set an exception handler on the read stream.

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Fetch the specified <code>amount</code> of elements. If the <code>ReadStream</code> has been paused, reading will recommence with the specified <code>amount</code> of items, otherwise the specified <code>amount</code> will be added to the current stream demand.

fetch( $arg0) : $this

Arguments

$arg0

integer

Response

$this

a reference to this, so the API can be used fluently

Set a data handler. As data is read, the handler will be called with the data.

handler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Pause the <code>ReadStream</code>, it sets the buffer in <code>fetch</code> mode and clears the actual demand.

pause() : $this

While it's paused, no data will be sent to the data handler.

Response

$this

a reference to this, so the API can be used fluently

Pause this stream and return a to transfer the elements of this stream to a destination .

pipe() : \io\vertx\jphp\redis\client\Pipe<Response>

The stream will be resumed when the pipe will be wired to a WriteStream.

Response

\io\vertx\jphp\redis\client\Pipe

a pipe

Pipe this <code>ReadStream</code> to the <code>WriteStream</code>.

pipeTo( $arg0,  $arg1) : void

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.

Arguments

$arg0

WriteStream

$arg1

callable

Resume reading, and sets the buffer in <code>flowing</code> mode.

resume() : $this

If the ReadStream has been paused, reading will recommence on it.

Response

$this

a reference to this, so the API can be used fluently

Send the given command to the redis server or cluster.

send( $arg0,  $arg1) : $this

Arguments

$arg0

Request

$arg1

callable

Response

$this

fluent self.

Returns the address associated with this client.

socketAddress() : string

Response

string

the address.