Class AsyncCombiner<I,O>

java.lang.Object
org.aksw.jenax.graphql.sparql.AsyncCombiner<I,O>

public class AsyncCombiner<I,O> extends Object
Assemble a result from a collection of async contributions. A small wrapper around guava's Futures API.

Example:

 
   ListenableFuture<Y> future =
    AsyncCombiner.of(executorService, combineXsIntoY)
     .addTask(a).addTask(b)
     .exec() 
 
  • Field Details

    • executorService

      protected com.google.common.util.concurrent.ListeningExecutorService executorService
    • combiner

      protected Function<List<I>,O> combiner
    • tasks

      protected List<Callable<I>> tasks
  • Constructor Details

    • AsyncCombiner

      protected AsyncCombiner(com.google.common.util.concurrent.ListeningExecutorService executorService, Function<List<I>,O> combiner)
  • Method Details