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
@Inject public ConcurrentExecutor()
-
-
Method Details
-
destroy
@PreDestroy public void destroy()Destroy the internal thread pool. -
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:
io.github.ascopes.protobufmavenplugin.utils.MultipleFailuresException
- if any of the results raised exceptions. All results are collected prior to this being raised.
-