Class TicketAndPromise<T>

java.lang.Object
io.deephaven.web.client.api.impl.TicketAndPromise<T>
All Implemented Interfaces:
elemental2.promise.IThenable<T>

public class TicketAndPromise<T> extends Object implements 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

    Nested classes/interfaces inherited from interface elemental2.promise.IThenable

    elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<T extends Object,V extends Object>, elemental2.promise.IThenable.ThenOnRejectedCallbackFn<V extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    TicketAndPromise(Ticket ticket, elemental2.promise.Promise<T> promise, WorkerConnection connection)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    elemental2.promise.Promise<T>
     
    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
     
    then(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T,? extends V> onFulfilled)
     
    <V> elemental2.promise.IThenable<V>
    then(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T,? extends V> onFulfilled, elemental2.promise.IThenable.ThenOnRejectedCallbackFn<? extends V> onRejected)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • promise

      public elemental2.promise.Promise<T> promise()
    • ticket

      public Ticket ticket()
    • then

      public <V> TicketAndPromise<V> then(elemental2.promise.IThenable.ThenOnFulfilledCallbackFn<? super T,? extends V> onFulfilled)
      Specified by:
      then in interface elemental2.promise.IThenable<T>
    • race

      public <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. The intent of "race" here is unlike Promise.race(), where the first to succeed should resolve - instead, this raced call will be sent to the server even though the previous call has not successfully returned, and the server is responsible for ensuring they happen in the correct order.
      Type Parameters:
      V - type of the next call to perform
      Parameters:
      racedCall - the call to perform at the same time that any pending call is happening
      Returns:
      a new TicketAndPromise that will resolve when all work is successful
    • 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 interface elemental2.promise.IThenable<T>
    • release

      public void release()