public class SimpleReact extends java.lang.Object implements ReactBuilder
Constructor and Description |
---|
SimpleReact()
Construct a SimpleReact builder using standard thread pool.
|
SimpleReact(java.util.concurrent.Executor executor) |
SimpleReact(java.util.concurrent.Executor queueService,
java.util.concurrent.Executor executor,
com.nurkiewicz.asyncretry.RetryExecutor retrier,
java.lang.Boolean async) |
SimpleReact(java.util.concurrent.Executor executor,
com.nurkiewicz.asyncretry.RetryExecutor retrier) |
SimpleReact(java.util.concurrent.Executor executor,
com.nurkiewicz.asyncretry.RetryExecutor retrier,
java.lang.Boolean async) |
SimpleReact(java.util.concurrent.Executor executor,
com.nurkiewicz.asyncretry.RetryExecutor retrier,
java.util.concurrent.Executor queueCopier) |
Modifier and Type | Method and Description |
---|---|
<U> SimpleReactStream<U> |
construct(java.util.stream.Stream s) |
<R> SimpleReactStream<R> |
from(java.util.Collection<R> collection)
Start a reactive flow from a Collection using an Iterator
|
<U> SimpleReactStream<U> |
from(java.util.concurrent.CompletableFuture<U>... cf) |
<U> SimpleReactStream<U> |
from(java.util.concurrent.CompletableFuture<U> cf) |
<U> SimpleReactStream<java.lang.Double> |
from(java.util.stream.DoubleStream stream)
Start a reactive dataflow from a stream.
|
<U> SimpleReactStream<java.lang.Integer> |
from(java.util.stream.IntStream stream)
Start a reactive dataflow from a stream.
|
<U> SimpleReactStream<U> |
from(java.util.Iterator<U> iterator)
Start a reactive flow from a JDK Iterator
|
<U> SimpleReactStream<java.lang.Long> |
from(java.util.stream.LongStream stream)
Start a reactive dataflow from a stream.
|
<U> SimpleReactStream<U> |
from(java.util.stream.Stream<U> stream)
Start a reactive dataflow from a stream.
|
<U> SimpleReactStream<U> |
fromIterable(java.lang.Iterable<U> iter)
Start a reactive flow from a JDK Iterator
|
<U> SimpleReactStream<U> |
fromStream(java.util.stream.Stream<java.util.concurrent.CompletableFuture<U>> stream)
Start a reactive dataflow from a stream of CompletableFutures.
|
boolean |
isAsync() |
<U> SimpleReactStream<U> |
of(U... array) |
static SimpleReact |
parallelBuilder() |
static SimpleReact |
parallelBuilder(int parallelism)
Construct a new SimpleReact builder, with a new task executor and retry executor
with configured number of threads
|
static SimpleReact |
parallelCommonBuilder() |
SimpleReactStream<java.lang.Integer> |
range(int startInclusive,
int endExclusive) |
<U> SimpleReactStream<U> |
react(java.util.function.Supplier<U>... actions)
Start a reactive dataflow with an array of one-off-suppliers
|
<U> SimpleReactStream<U> |
reactCollection(java.util.Collection<java.util.function.Supplier<U>> actions)
Start a reactive dataflow with a list of one-off-suppliers
|
protected <U> SimpleReactStream<U> |
reactI(java.util.function.Supplier<U>... actions)
This internal method has been left protected, so it can be mocked / stubbed as some of the entry points are final
|
<U> SimpleReactStream<U> |
reactIterable(java.lang.Iterable<java.util.function.Supplier<U>> actions)
Start a reactive dataflow with a list of one-off-suppliers
|
<U> SimpleReactStream<U> |
reactIterator(java.util.Iterator<java.util.function.Supplier<U>> actions)
Start a reactive dataflow with a list of one-off-suppliers
|
<U> SimpleReactStream<U> |
reactStream(java.util.stream.Stream<java.util.function.Supplier<U>> actions)
Start a reactive dataflow with a list of one-off-suppliers
|
static SimpleReact |
sequentialBuilder() |
static SimpleReact |
sequentialCommonBuilder() |
SimpleReact |
withQueueCopyExecutor(java.util.concurrent.Executor queueCopyExecutor) |
public SimpleReact()
ThreadPools.getStandard()
public SimpleReact(java.util.concurrent.Executor executor, com.nurkiewicz.asyncretry.RetryExecutor retrier, java.lang.Boolean async)
public SimpleReact(java.util.concurrent.Executor executor)
executor
- Executor this SimpleReact instance will use to execute concurrent tasks.public SimpleReact(java.util.concurrent.Executor executor, com.nurkiewicz.asyncretry.RetryExecutor retrier)
public SimpleReact(java.util.concurrent.Executor executor, com.nurkiewicz.asyncretry.RetryExecutor retrier, java.util.concurrent.Executor queueCopier)
public SimpleReact(java.util.concurrent.Executor queueService, java.util.concurrent.Executor executor, com.nurkiewicz.asyncretry.RetryExecutor retrier, java.lang.Boolean async)
public <U> SimpleReactStream<U> construct(java.util.stream.Stream s)
public SimpleReact withQueueCopyExecutor(java.util.concurrent.Executor queueCopyExecutor)
public <U> SimpleReactStream<U> reactCollection(java.util.Collection<java.util.function.Supplier<U>> actions)
actions
- List of Suppliers to provide data (and thus events) that
downstream jobs will react toopublic <U> SimpleReactStream<U> reactStream(java.util.stream.Stream<java.util.function.Supplier<U>> actions)
actions
- Stream of Suppliers to provide data (and thus events) that
downstream jobs will react toopublic <U> SimpleReactStream<U> reactIterator(java.util.Iterator<java.util.function.Supplier<U>> actions)
actions
- Iterator over Suppliers to provide data (and thus events) that
downstream jobs will react toopublic <U> SimpleReactStream<U> reactIterable(java.lang.Iterable<java.util.function.Supplier<U>> actions)
actions
- Stream of Suppliers to provide data (and thus events) that
downstream jobs will react too@SafeVarargs public final <U> SimpleReactStream<U> react(java.util.function.Supplier<U>... actions)
actions
- Array of Suppliers to provide data (and thus events) that
downstream jobs will react tooprotected <U> SimpleReactStream<U> reactI(java.util.function.Supplier<U>... actions)
public <U> SimpleReactStream<U> from(java.util.stream.Stream<U> stream)
stream
- that will be used to drive the reactive dataflowpublic <R> SimpleReactStream<R> from(java.util.Collection<R> collection)
collection
- - Collection SimpleReact will iterate over at the start of the flowpublic boolean isAsync()
public static SimpleReact parallelBuilder()
SimpleReact()
public static SimpleReact parallelBuilder(int parallelism)
parallelism
- Number of threads task executor should havepublic static SimpleReact parallelCommonBuilder()
see RetryBuilder#getDefaultInstance()
public static SimpleReact sequentialBuilder()
public static SimpleReact sequentialCommonBuilder()
public SimpleReactStream<java.lang.Integer> range(int startInclusive, int endExclusive)
public <U> SimpleReactStream<U> from(java.util.Iterator<U> iterator)
iterator
- SimpleReact will iterate over this iterator concurrently to start the reactive dataflowpublic <U> SimpleReactStream<U> fromIterable(java.lang.Iterable<U> iter)
iter
- SimpleReact will iterate over this iterator concurrently to start the reactive dataflowpublic <U> SimpleReactStream<U> fromStream(java.util.stream.Stream<java.util.concurrent.CompletableFuture<U>> stream)
stream
- of CompletableFutures that will be used to drive the reactive dataflowpublic <U> SimpleReactStream<java.lang.Integer> from(java.util.stream.IntStream stream)
stream
- that will be used to drive the reactive dataflowpublic <U> SimpleReactStream<java.lang.Double> from(java.util.stream.DoubleStream stream)
stream
- that will be used to drive the reactive dataflowpublic <U> SimpleReactStream<java.lang.Long> from(java.util.stream.LongStream stream)
stream
- that will be used to drive the reactive dataflowpublic <U> SimpleReactStream<U> of(U... array)
public <U> SimpleReactStream<U> from(java.util.concurrent.CompletableFuture<U> cf)
public <U> SimpleReactStream<U> from(java.util.concurrent.CompletableFuture<U>... cf)