public class MultiJob<P> extends Jobs<P>
https://dzone.com/articles/think-twice-using-java-8,
https://www.baeldung.com/java-completablefutureJobs.JobException, Jobs.UserFunction<T,R>| Modifier and Type | Field and Description |
|---|---|
protected Executor |
threadPool |
REQUIRED_INPUT_TEMPLATE_MSG, timeout| Modifier | Constructor and Description |
|---|---|
protected |
MultiJob(Stream<P> params,
JobContext jobContext) |
| Modifier and Type | Method and Description |
|---|---|
protected <R> Function<CompletableFuture<R>,R> |
createGrabber() |
<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 MultiJob(@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.JobExceptionprotected <R> Function<CompletableFuture<R>,R> createGrabber()
Copyright 2015, Pavel Ponec