public class ParallelJob<P> extends Jobs<P>
https://www.baeldung.com/java-fork-join,
https://stackoverflow.com/questions/21163108/custom-thread-pool-in-java-8-parallel-streamJobs.JobException, Jobs.UserFunction<T,R>| Modifier and Type | Field and Description |
|---|---|
protected static String |
REQUIRED_INPUT_TEMPLATE_MSG
Template message for an invalid input
|
protected ForkJoinPool |
threadPool
Thread pool
|
| Modifier | Constructor and Description |
|---|---|
protected |
ParallelJob(Stream<P> params,
JobContext jobContext) |
| Modifier and Type | Method and Description |
|---|---|
<R> Stream<R> |
run(Jobs.UserFunction<P,R> job)
Get of single values where all nulls are excluded
|
<R> Stream<R> |
runOfStream(Jobs.UserFunction<P,Stream<R>> job)
Get result of a Streams
|
getParallel, runOfSum, setTimeoutprotected static final String REQUIRED_INPUT_TEMPLATE_MSG
@Nonnull protected final ForkJoinPool threadPool
protected ParallelJob(@Nonnull Stream<P> params, @Nonnull JobContext jobContext)
public <R> Stream<R> run(@Nonnull Jobs.UserFunction<P,R> job) throws Jobs.JobException
run in class Jobs<P>job - Job with a simple value resultJobs.JobExceptionpublic <R> Stream<R> runOfStream(@Nonnull Jobs.UserFunction<P,Stream<R>> job) throws Jobs.JobException
runOfStream in class Jobs<P>job - Job with a stream resultJobs.JobExceptionCopyright 2015, Pavel Ponec