RabbitMQConsumer

A stream of messages from a rabbitmq queue.

package

Default

Methods

__construct

__construct() 

Stop message consumption from a queue.

cancel( $arg0 = null) : void

The operation is asynchronous. When consumption will be stopped, you can by notified via @see \io\vertx\jphp\rabbitmq\RabbitMQConsumer::endHandler cancel() Stop message consumption from a queue.

The operation is asynchronous. When consumption will be stopped, you can by notified via @see \io\vertx\jphp\rabbitmq\RabbitMQConsumer::endHandler param $cancelResult [callable] contains information about operation status: success/fail. cancel($cancelResult)

Arguments

$arg0

callable

consumerTag

consumerTag() : string

Response

string

a consumer tag

Set an end handler. Once the stream has canceled successfully, the 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 message handler. As message appear in a queue, the handler will be called with the message.

handler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

isPaused

isPaused() : boolean

Response

boolean

is the stream paused?

Pause the stream of incoming messages from queue.

pause() : $this

The messages will continue to arrive, but they will be stored in a internal queue. If the queue size would exceed the limit provided by , then incoming messages will be discarded.

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\rabbitmq\Pipe<RabbitMQMessage>

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

Response

\io\vertx\jphp\rabbitmq\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 from a queue. Flushes internal queue.

resume() : $this

Response

$this

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