Package org.aksw.jenax.graphql.sparql
Class AsyncCombiner<I,O>
java.lang.Object
org.aksw.jenax.graphql.sparql.AsyncCombiner<I,O>
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAsyncCombiner(com.google.common.util.concurrent.ListeningExecutorService executorService, Function<List<I>, O> combiner) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<O>exec()static <I,O> AsyncCombiner<I, O> of(com.google.common.util.concurrent.ListeningExecutorService executorService, Function<List<I>, O> combiner) static <I,O> AsyncCombiner<I, O> of(ExecutorService executorService, Function<List<I>, O> combiner)
-
Field Details
-
executorService
protected com.google.common.util.concurrent.ListeningExecutorService executorService -
combiner
-
tasks
-
-
Constructor Details
-
AsyncCombiner
-
-
Method Details
-
of
public static <I,O> AsyncCombiner<I,O> of(ExecutorService executorService, Function<List<I>, O> combiner) -
of
public static <I,O> AsyncCombiner<I,O> of(com.google.common.util.concurrent.ListeningExecutorService executorService, Function<List<I>, O> combiner) -
addTask
-
exec
-