Class CompletingFutureContribution<T,U>

java.lang.Object
org.apache.hc.core5.concurrent.FutureContribution<T>
org.apache.hc.core5.concurrent.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 Details

    • resultProvider

      private final Function<T,U> resultProvider
  • Constructor Details

    • 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, 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 Details

    • completed

      public void completed(T result)