Class Promise<T extends AbstractDeferred>

    • Constructor Detail

      • Promise

        public Promise​(T deferred)
    • Method Detail

      • then

        public void then​(PromiseListener listener)
        Adds a listener that is called once the promise is settled. NOTE: If the promise is already settled when adding the listener, the thread adding the listener will be used to execute the listener.
        Parameters:
        listener - the listener that will be called once the promise is settled
      • isFulfilled

        public boolean isFulfilled()
      • isRejected

        public boolean isRejected()
      • isSettled

        public boolean isSettled()
        Returns:
        true if the promise is fulfilled or rejected; false if the promise is pending.