Interface Promise<V>

    • Method Detail

      • setSuccess

        Promise<V> setSuccess​(V result)
        Marks this future as a success and notifies all listeners.

        If it is success or failed already it will throw an IllegalStateException.

      • trySuccess

        boolean trySuccess​(V result)
        Marks this future as a success and notifies all listeners.
        Returns:
        true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.
      • setFailure

        Promise<V> setFailure​(Throwable cause)
        Marks this future as a failure and notifies all listeners.

        If it is success or failed already it will throw an IllegalStateException.

      • tryFailure

        boolean tryFailure​(Throwable cause)
        Marks this future as a failure and notifies all listeners.
        Returns:
        true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.
      • addListener

        Promise<V> addListener​(FutureListener<? extends Future<? super V>> listener)
        Description copied from interface: Future
        Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.
        Specified by:
        addListener in interface Future<V>
      • removeListener

        Promise<V> removeListener​(FutureListener<? extends Future<? super V>> listener)
        Description copied from interface: Future
        Removes the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.
        Specified by:
        removeListener in interface Future<V>