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

Resume reading from a queue. Flushes internal queue.

resume() : $this

Response

$this

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