Represents a message that is received from the event bus in a handler.
Messages have a @see \io\vertx\jphp\core\eventbus\Message::body, which can be null, and also @see \io\vertx\jphp\core\eventbus\Message::headers, which can be empty.
If the message was sent specifying a reply handler, it can be replied to using @see \io\vertx\jphp\core\eventbus\Message::reply.
If you want to notify the sender that processing failed, then @see \io\vertx\jphp\core\eventbus\Message::fail can be called.
package |
Default |
---|
__construct()
address() : string
string
body() : mixed
mixed
the body, or null.
fail( $arg0, $arg1) : void
If the message was sent specifying a result handler the handler will be called with a failure corresponding to the failure code and message specified here.
integer
string
headers() : \io\vertx\jphp\core\MultiMap
isSend() : boolean
boolean
true if this is a send.
reply( $arg0, $arg1 = null) : void
If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing. param $message [mixed] the message to reply with. reply($message) Link @see \io\vertx\jphp\core\eventbus\Message::reply but allows you to specify delivery options for the reply. param $message [mixed] the reply message param $options [array] the delivery options reply($message, $options)
mixed
array
replyAddress() : string
string
the reply address, or null, if message was sent without a reply handler.
replyAndRequest( $arg0, $arg1, $arg2 = null) : void
to receive the reply to the reply.
If the message was sent specifying a reply handler, that handler will be
called when it has received a reply. If the message wasn't sent specifying a receipt handler
this method does nothing.
param $message [mixed] the message to reply with.
param $replyHandler [callable] the reply handler for the reply.
replyAndRequest($message, $replyHandler)
Like @see \io\vertx\jphp\core\eventbus\Message::replyAndRequest but specifying options
that can be used
to configure the delivery.
param $message [mixed] the message body, may be {@code null}
param $options [array] delivery options
param $replyHandler [callable] reply handler will be called when any reply from the recipient is received
replyAndRequest($message, $options, $replyHandler)
mixed
callable | array
callable