MessageConsumer

An event bus consumer object representing a stream of message to an @see \io\vertx\jphp\core\eventbus\EventBus address that can be read from.

The @see \io\vertx\jphp\core\eventbus\EventBus::consumer or @see \io\vertx\jphp\core\eventbus\EventBus::localConsumer creates a new consumer, the returned consumer is not yet registered against the event bus. Registration is effective after the @see \io\vertx\jphp\core\eventbus\MessageConsumer::handler method is invoked.

The consumer is unregistered from the event bus using the @see \io\vertx\jphp\core\eventbus\MessageConsumer::unregister method or by calling the

see

with a null value..

package

Default

Methods

__construct

__construct() 

address

address() : string

Response

string

The address the handler was registered with.

bodyStream

bodyStream() : \io\vertx\jphp\core\eventbus\ReadStream<T>

Response

\io\vertx\jphp\core\eventbus\ReadStream

a read stream for the body of the message stream.

Optional method which can be called to indicate when the registration has been propagated across the cluster.

completionHandler( $arg0) : void

Arguments

$arg0

callable

endHandler

endHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

fetch

fetch( $arg0) : $this

Arguments

$arg0

integer

Response

$this

getMaxBufferedMessages

getMaxBufferedMessages() : integer

Response

integer

the maximum number of messages that can be buffered when this stream is paused

handler

handler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

isRegistered

isRegistered() : boolean

Response

boolean

true if the current consumer is registered

pause

pause() : $this

Response

$this

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

pipe() : \io\vertx\jphp\core\eventbus\Pipe<Message<T>>

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

Response

\io\vertx\jphp\core\eventbus\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<Message>] 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<Message>

$arg1

callable

resume

resume() : $this

Response

$this

Set the number of messages this registration will buffer when this stream is paused. The default value is <code>1000</code>.

setMaxBufferedMessages( $arg0) : \io\vertx\jphp\core\eventbus\MessageConsumer<T>

When a new value is set, buffered messages may be discarded to reach the new value. The most recent messages will be kept.

Arguments

$arg0

integer

Response

\io\vertx\jphp\core\eventbus\MessageConsumer

this registration

Unregisters the handler which created this registration

unregister( $arg0 = null) : void

unregister()

Unregisters the handler which created this registration

param $completionHandler [callable] the handler called when the unregister is done. For example in a cluster when all nodes of the event bus have been unregistered. unregister($completionHandler)

Arguments

$arg0

callable