java.lang.Object
com.pivovarit.collectors.Dispatcher<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CompletableFuture
<Void> private final ExecutorService
private final Executor
private final Semaphore
private static final Runnable
private boolean
private final AtomicBoolean
private final BlockingQueue
<Runnable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FutureTask
<Void> completionTask
(Supplier<T> supplier, Dispatcher.InterruptibleCompletableFuture<T> future) private static ExecutorService
(package private) CompletableFuture
<T> (package private) static <T> Dispatcher
<T> private void
(package private) boolean
private static void
requireValidExecutor
(Executor executor) (package private) void
start()
(package private) void
stop()
(package private) static <T> Dispatcher
<T> virtual()
-
Field Details
-
POISON_PILL
-
completionSignaller
-
workingQueue
-
dispatcher
-
executor
-
limiter
-
started
-
shortCircuited
private volatile boolean shortCircuited
-
-
Constructor Details
-
Dispatcher
private Dispatcher() -
Dispatcher
-
-
Method Details
-
from
-
virtual
-
start
void start() -
stop
void stop() -
isRunning
boolean isRunning() -
enqueue
-
completionTask
private FutureTask<Void> completionTask(Supplier<T> supplier, Dispatcher.InterruptibleCompletableFuture<T> future) -
handle
-
shortcircuit
private static Function<Throwable,Void> shortcircuit(Dispatcher.InterruptibleCompletableFuture<?> future) -
defaultExecutorService
-
requireValidExecutor
-