Package io.deephaven.web.client.api.impl
Class TicketAndPromise<T>
java.lang.Object
io.deephaven.web.client.api.impl.TicketAndPromise<T>
- All Implemented Interfaces:
elemental2.promise.IThenable<T>
Pair of ticket and the promise that indicates it has been resolved. Tickets are usable before they are resolved, but
to ensure that all operations completed successfully, the promise should be used to handle errors.
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionTicketAndPromise
(Ticket ticket, elemental2.promise.Promise<T> promise, WorkerConnection connection) TicketAndPromise
(Ticket ticket, WorkerConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionelemental2.promise.Promise<T>
promise()
<V> TicketAndPromise<V>
race
(JsFunction<Ticket, elemental2.promise.IThenable<V>> racedCall) Rather than waiting for the original promise to succeed, lets the caller start a new call based only on the original ticket.void
release()
<V> TicketAndPromise<V>
<V> elemental2.promise.IThenable<V>
then
(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T, ? extends V> onFulfilled, elemental2.promise.IThenable.ThenOnRejectedCallbackFn<? extends V> onRejected) ticket()
-
Constructor Details
-
TicketAndPromise
public TicketAndPromise(Ticket ticket, elemental2.promise.Promise<T> promise, WorkerConnection connection) -
TicketAndPromise
-
-
Method Details
-
promise
-
ticket
-
then
public <V> TicketAndPromise<V> then(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T, ? extends V> onFulfilled) - Specified by:
then
in interfaceelemental2.promise.IThenable<T>
-
then
public <V> elemental2.promise.IThenable<V> then(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T, ? extends V> onFulfilled, elemental2.promise.IThenable.ThenOnRejectedCallbackFn<? extends V> onRejected) - Specified by:
then
in interfaceelemental2.promise.IThenable<T>
-
release
public void release()
-