Class Promise<T>


  • public class Promise<T>
    extends Object
    Represents the writable side of an action that may, or may not, have occurred yet.

    The future() method returns the Future associated with a promise, the future can be used for getting notified of the promise completion and retrieve its value.

    A promise extends Handler> so it can be used as a callback.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • Promise

        public Promise​(io.vertx.core.Promise delegate)
      • Promise

        public Promise​(io.vertx.core.Promise delegate,
                       TypeArg<T> typeArg_0)
    • Method Detail

      • getDelegate

        public io.vertx.core.Promise getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • promise

        public static <T> Promise<T> promise()
        Returns:
        the promise
      • complete

        public void complete​(T result)
        Parameters:
        result - the result
      • complete

        public void complete()
      • fail

        public void fail​(Throwable cause)
        Parameters:
        cause - the failure cause
      • fail

        public void fail​(String message)
        Parameters:
        message - the failure message
      • tryComplete

        public boolean tryComplete​(T result)
        Parameters:
        result - the result
        Returns:
        false when the future is already completed
      • tryComplete

        public boolean tryComplete()
        Returns:
        false when the future is already completed
      • tryFail

        public boolean tryFail​(Throwable cause)
        Parameters:
        cause - the failure cause
        Returns:
        false when the future is already completed
      • tryFail

        public boolean tryFail​(String message)
        Parameters:
        message - the failure message
        Returns:
        false when the future is already completed
      • future

        public Future<T> future()
        Returns:
        the Future associated with this promise, it can be used to be aware of the promise completion
      • newInstance

        public static <T> Promise<T> newInstance​(io.vertx.core.Promise arg)
      • newInstance

        public static <T> Promise<T> newInstance​(io.vertx.core.Promise arg,
                                                 TypeArg<T> __typeArg_T)