Represents an event that occurs on the event bus bridge.
Please consult the documentation for a full explanation.
| package |
Default |
|---|
__construct()
cause() : \Exception
\Exceptionthe cause or null if the operation succeeded.
complete( $arg0 = null) : void
complete()
Set the result. Any handler will be called, if there is one, and the future will be marked as completed.
param $result [boolean] the result complete($result)
boolean
completer() : callable
callablean handler completing this future
compose( $arg0, $arg1 = null) : \io\vertx\jphp\ext\web\handler\sockjs\Future<U>
When this future (the one on which compose is called) succeeds, the mapper will be called with
the completed value and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
param $mapper [callable] the mapper function compose($mapper)
Compose this future with a provided next future.
When this (the one on which compose is called) future succeeds, the handler will be called with
the completed value, this handler should complete the next future.
If the handler throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the next future and the handler
will not be called.
param $handler [callable] the handler param $next [Future] the next future compose($handler, $next)
callable
Future
\io\vertx\jphp\ext\web\handler\sockjs\Futurethe composed future
fail( $arg0) : void
param $cause [\Exception] the failure cause fail($cause)
Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed.
param $failureMessage [string] the failure message fail($failureMessage)
string | \Exception
failed() : boolean
booleantrue if it failed or false otherwise
getRawMessage() : array
arraythe raw JSON message for the event
isComplete() : boolean
booleantrue if completed, false if not
map( $arg0) : \io\vertx\jphp\ext\web\handler\sockjs\Future<U>
When this future succeeds, the mapper will be called with the completed value and this mapper
returns a value. This value will complete the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
param $mapper [callable] the mapper function map($mapper)
Map the result of a future to a specific value.
When this future succeeds, this value will complete the future returned by this method call.
When this future fails, the failure will be propagated to the returned future.
param $value [mixed] the value that eventually completes the mapped future map($value)
callable | mixed
\io\vertx\jphp\ext\web\handler\sockjs\Futurethe mapped future
mapEmpty() : \io\vertx\jphp\ext\web\handler\sockjs\Future<V>
This is a conveniency for future.map((T) null) or future.map((Void) null).
When this future succeeds, null will complete the future returned by this method call.
When this future fails, the failure will be propagated to the returned future.
\io\vertx\jphp\ext\web\handler\sockjs\Futurethe mapped future
otherwise( $arg0) : \io\vertx\jphp\ext\web\handler\sockjs\Future<Boolean>
When this future fails, the mapper will be called with the completed value and this mapper
returns a value. This value will complete the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future succeeds, the result will be propagated to the returned future and the mapper
will not be called.
param $mapper [callable] the mapper function otherwise($mapper)
Map the failure of a future to a specific value.
When this future fails, this value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
param $value [boolean] the value that eventually completes the mapped future otherwise($value)
callable | boolean
\io\vertx\jphp\ext\web\handler\sockjs\Futurethe mapped future
otherwiseEmpty() : \io\vertx\jphp\ext\web\handler\sockjs\Future<Boolean>
This is a convenience for future.otherwise((T) null).
When this future fails, the null value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
\io\vertx\jphp\ext\web\handler\sockjs\Futurethe mapped future
recover( $arg0) : \io\vertx\jphp\ext\web\handler\sockjs\Future<Boolean>
If the mapper fails, then the returned future will be failed with this failure.
callable
\io\vertx\jphp\ext\web\handler\sockjs\FutureA recovered future
result() : boolean
booleanthe result or null if the operation failed.
setHandler( $arg0) : $this
If the future has already been completed it will be called immediately. Otherwise it will be called when the future is completed.
callable
$thisa reference to this, so it can be used fluently
setRawMessage( $arg0) : $this
array
$thisthis reference, so it can be used fluently
socket() : \io\vertx\jphp\ext\web\handler\sockjs\SockJSSocket
succeeded() : boolean
booleantrue if it succeded or false otherwise
tryComplete( $arg0 = null) : boolean
tryComplete()
Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.
param $result [boolean] the result tryComplete($result)
boolean
booleanfalse when the future is already completed
tryFail( $arg0) : boolean
param $cause [\Exception] the failure cause tryFail($cause)
Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed.
param $failureMessage [string] the failure message tryFail($failureMessage)
string | \Exception
booleanfalse when the future is already completed
type() : string
stringthe type of the event