BridgeEvent

Represents an event that occurs on the event bus bridge.

Please consult the documentation for a full explanation.

package

Default

Methods

__construct

__construct() 

Calls <code>complete(null)</code>

complete( $arg0 = null) : void

complete()

Set the result. Any handler will be called, if there is one, and the promise will be marked as completed.

Any handler set on the associated promise will be called.

param $result [boolean] the result complete($result)

Arguments

$arg0

boolean

Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.

fail( $arg0) : void

param $cause [\Exception] the failure cause fail($cause)

Calls @see \io\vertx\jphp\core\Promise::fail with the message.

param $message [string] the failure message fail($message)

Arguments

$arg0

string | \Exception

future

future() : \io\vertx\jphp\ext\eventbus\bridge\tcp\Future<Boolean>

Response

\io\vertx\jphp\ext\eventbus\bridge\tcp\Future

the {@link Future} associated with this promise, it can be used to be aware of the promise completion

Get the raw JSON message for the event. This will be null for SOCKET_CREATED or SOCKET_CLOSED events as there is no message involved. If the returned message is modified, @see \io\vertx\jphp\ext\eventbus\bridge\tcp\BridgeEvent::setRawMessage should be called with the new message.

getRawMessage() : array

Response

array

the raw JSON message for the event

Get the raw JSON message for the event. This will be null for SOCKET_CREATED or SOCKET_CLOSED events as there is no message involved.

setRawMessage( $arg0) : $this

Arguments

$arg0

array

Response

$this

this reference, so it can be used fluently

Get the SockJSSocket instance corresponding to the event

socket() : \io\vertx\jphp\core\net\NetSocket

Response

\io\vertx\jphp\core\net\NetSocket

the SockJSSocket instance

Calls <code>tryComplete(null)</code>.

tryComplete( $arg0 = null) : boolean

tryComplete()

Like @see \io\vertx\jphp\core\Promise::complete but returns false when the promise is already completed instead of throwing an \java.lang.IllegalStateException, it returns true otherwise.

param $result [boolean] the result tryComplete($result)

Arguments

$arg0

boolean

Response

boolean

{@code false} when the future is already completed

Like @see \io\vertx\jphp\core\Promise::fail but returns <code>false</code> when the promise is already completed instead of throwing an {@link java.lang.IllegalStateException}, it returns <code>true</code> otherwise.

tryFail( $arg0) : boolean

param $cause [\Exception] the failure cause tryFail($cause)

Calls @see \io\vertx\jphp\core\Promise::fail with the message.

param $message [string] the failure message tryFail($message)

Arguments

$arg0

string | \Exception

Response

boolean

{@code false} when the future is already completed

type

type() : string

Response

string

the type of the event