Class ConcurrentExecutor
java.lang.Object
io.github.ascopes.protobufmavenplugin.utils.ConcurrentExecutor
Helper component that allows scheduling IO-bound tasks within a thread pool.
- Since:
- 2.2.0
- Author:
- Ashley Scopes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<R> Collector
<FutureTask<R>, ?, List<R>> awaiting()
Return a reactive collector of all the results of a stream of scheduled tasks.void
destroy()
Destroy the internal thread pool.<R> FutureTask
<R>
-
Constructor Details
-
ConcurrentExecutor
public ConcurrentExecutor()
-
-
Method Details
-
destroy
Destroy the internal thread pool.- Throws:
InterruptedException
- if destruction timed out or the thread was interrupted.
-
submit
-
awaiting
Return a reactive collector of all the results of a stream of scheduled tasks.- Type Parameters:
R
- the task return type.- Returns:
- the collector.
- Throws:
MultipleFailuresException
- if any of the results raised exceptions. All results are collected prior to this being raised.
-