A Vert.x event-bus is a light-weight distributed messaging system which allows different parts of your application, or different applications and services to communicate with each in a loosely coupled way.
An event-bus supports publish-subscribe messaging, point-to-point messaging and request-response messaging.
Message delivery is best-effort and messages can be lost if failure of all or part of the event bus occurs.
Please refer to the documentation for more information on the event bus.
package |
Default |
---|
__construct()
addInboundInterceptor( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
addOutboundInterceptor( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
consumer( $arg0, $arg1 = null) : \io\vertx\jphp\core\eventbus\MessageConsumer<T>
The returned consumer is not yet registered at the address, registration will be effective when @see \io\vertx\jphp\core\eventbus\MessageConsumer::handler is called. param $address [string] the address that it will register it at consumer($address) Create a consumer and register it against the specified address. param $address [string] the address that will register it at param $handler [callable] the handler that will process the received messages consumer($address, $handler)
string
callable
\io\vertx\jphp\core\eventbus\MessageConsumer
the event bus message consumer
isMetricsEnabled() : boolean
boolean
{@code true} if metrics are enabled
localConsumer( $arg0, $arg1 = null) : \io\vertx\jphp\core\eventbus\MessageConsumer<T>
param $address [string] the address to register it at localConsumer($address)
Like @see \io\vertx\jphp\core\eventbus\EventBus::consumer but the address won't be propagated across the cluster.
param $address [string] the address that will register it at param $handler [callable] the handler that will process the received messages localConsumer($address, $handler)
string
callable
\io\vertx\jphp\core\eventbus\MessageConsumer
the event bus message consumer
publish( $arg0, $arg1, $arg2 = null) : $this
param $address [string] the address to publish it to param $message [mixed] the message, may be {@code null} publish($address, $message)
Like @see \io\vertx\jphp\core\eventbus\EventBus::publish but specifying options
that can be used to configure the delivery.
param $address [string] the address to publish it to param $message [mixed] the message, may be {@code null} param $options [DeliveryOptions | array] the delivery options publish($address, $message, $options)
string
mixed
array | DeliveryOptions
$this
a reference to this, so the API can be used fluently
publisher( $arg0, $arg1 = null) : \io\vertx\jphp\core\eventbus\MessageProducer<T>
The returned publisher will invoke the @see \io\vertx\jphp\core\eventbus\EventBus::publish method when the stream @see \io\vertx\jphp\core\streams\WriteStream::write method is called with the publisher address and the provided data. param $address [string] The address to publish it to publisher($address) Like @see \io\vertx\jphp\core\eventbus\EventBus::publisher but specifying delivery options that will be used for configuring the delivery of the message. param $address [string] the address to publish it to param $options [DeliveryOptions | array] the delivery options publisher($address, $options)
string
array | DeliveryOptions
\io\vertx\jphp\core\eventbus\MessageProducer
The publisher
removeInboundInterceptor( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
removeOutboundInterceptor( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
send( $arg0, $arg1, $arg2 = null, $arg3 = null) : $this
The message will be delivered to at most one of the handlers registered to the address.
param $address [string] the address to send it to
param $message [mixed] the message, may be {@code null}
send($address, $message)
Like @see \io\vertx\jphp\core\eventbus\EventBus::send but specifying a replyHandler
that will be called if the recipient
subsequently replies to the message.
param $address [string] the address to send it to
param $message [mixed] the message, may be {@code null}
param $replyHandler [callable] reply handler will be called when any reply from the recipient is received, may be {@code null}
send($address, $message, $replyHandler)
Like @see \io\vertx\jphp\core\eventbus\EventBus::send but specifying options
that can be used to configure the delivery.
param $address [string] the address to send it to
param $message [mixed] the message, may be {@code null}
param $options [DeliveryOptions | array] delivery options
send($address, $message, $options)
Like @see \io\vertx\jphp\core\eventbus\EventBus::send but specifying a replyHandler
that will be called if the recipient
subsequently replies to the message.
param $address [string] the address to send it to
param $message [mixed] the message, may be {@code null}
param $options [DeliveryOptions | array] delivery options
param $replyHandler [callable] reply handler will be called when any reply from the recipient is received, may be {@code null}
send($address, $message, $options, $replyHandler)
string
mixed
callable | array | DeliveryOptions
callable
$this
a reference to this, so the API can be used fluently
sender( $arg0, $arg1 = null) : \io\vertx\jphp\core\eventbus\MessageProducer<T>
The returned sender will invoke the @see \io\vertx\jphp\core\eventbus\EventBus::send method when the stream @see \io\vertx\jphp\core\streams\WriteStream::write method is called with the sender address and the provided data. param $address [string] the address to send it to sender($address) Like @see \io\vertx\jphp\core\eventbus\EventBus::sender but specifying delivery options that will be used for configuring the delivery of the message. param $address [string] the address to send it to param $options [DeliveryOptions | array] the delivery options sender($address, $options)
string
array | DeliveryOptions
\io\vertx\jphp\core\eventbus\MessageProducer
The sender