Redis

A simple Redis client.

package

Default

Methods

__construct

__construct() 

batch

batch( $arg0,  $arg1) : $this

Arguments

$arg0

array

$arg1

callable

Response

$this

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 [SocketAddress] createClient($vertx, $address)

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

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

Arguments

$arg0

Vertx

$arg1

array | RedisOptions | SocketAddress

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

Like @see \io\vertx\jphp\core\streams\ReadStream::pipeTo but with no completion handler.

pipeTo( $arg0,  $arg1 = null) : void

param $dst [WriteStream] pipeTo($dst)

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. param $dst [WriteStream] the destination write stream param $handler [callable] pipeTo($dst, $handler)

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

send( $arg0,  $arg1) : $this

Arguments

$arg0

Request

$arg1

callable

Response

$this

Returns the address associated with this client.

socketAddress() : \io\vertx\jphp\core\net\SocketAddress