Class CompletingFutureContribution<T,​U>

  • Type Parameters:
    T - the future result type of an asynchronous operation for this type.
    U - the future result type of an asynchronous operation for the FutureCallback.
    All Implemented Interfaces:
    FutureCallback<T>

    public class CompletingFutureContribution<T,​U>
    extends FutureContribution<T>
    Completes a result on a BasicFuture.
    Since:
    5.4
    • Field Detail

      • resultProvider

        private final java.util.function.Function<T,​U> resultProvider
    • Constructor Detail

      • CompletingFutureContribution

        public CompletingFutureContribution​(BasicFuture<U> future)
        Constructs a new instance to callback the given BasicFuture.
        Parameters:
        future - The callback.
      • CompletingFutureContribution

        public CompletingFutureContribution​(BasicFuture<U> future,
                                            java.util.function.Function<T,​U> resultProvider)
        Constructs a new instance to callback the given BasicFuture.
        Parameters:
        future - The callback.
        resultProvider - Provides the result to complete the future.
    • Method Detail

      • completed

        public void completed​(T result)