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

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