public class OptimizedLazyReact
extends java.lang.Object
Constructor and Description |
---|
OptimizedLazyReact() |
Modifier and Type | Method and Description |
---|---|
<T> LazyFutureStream<T> |
of(java.util.Collection<T> collection)
Generate a FutureStream from the specified Collection.
|
<T> LazyFutureStream<T> |
of(java.util.stream.Stream<T> stream)
Generate a FutureStream from the specified Stream.
|
<T> LazyFutureStream<T> |
of(T... elements)
Generate a FutureStream from the specified elements.
|
<T> LazyFutureStream<T> |
ofIterable(java.lang.Iterable<T> iterable)
Generate a FutureStream from the specified Iterable.
|
<T> LazyFutureStream<T> |
react(java.util.Collection<java.util.function.Supplier<T>> suppliers)
Generate a FutureStream from the specified Collection of Suppliers.
|
<T> LazyFutureStream<T> |
react(java.util.stream.Stream<java.util.function.Supplier<T>> suppliers)
Generate a FutureStream from the specified Stream of Suppliers.
|
<T> LazyFutureStream<T> |
react(java.util.function.Supplier<T>... suppliers)
Generate a FutureStream from the specified Suppliers.
|
<T> LazyFutureStream<T> |
reactIterable(java.lang.Iterable<java.util.function.Supplier<T>> suppliers)
Generate a FutureStream from the specified Iterable of Suppliers.
|
public <T> LazyFutureStream<T> of(T... elements)
microReact.of(ioCallURL1,ioCallURL2,ioCallURL3) //each URL is wrapped in a task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
elements
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> of(java.util.stream.Stream<T> stream)
microReact.of(Stream.of(ioCallURL1,ioCallURL2,ioCallURL3)) //each URL is wrapped in a task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
stream
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> of(java.util.Collection<T> collection)
microReact.of(Arrays.asList(ioCallURL1,ioCallURL2,ioCallURL3)) //each URL is wrapped in a task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
collection
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> ofIterable(java.lang.Iterable<T> iterable)
microReact.ofIterable(Arrays.asList(ioCallURL1,ioCallURL2,ioCallURL3)) //each URL is wrapped in a task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
iterable
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> react(java.util.function.Supplier<T>... suppliers)
microReact.react(()->ioCallURL1,()->ioCallURL2,()->ioCallURL3) //each URL Supplier is an Async task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
suppliers
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> react(java.util.stream.Stream<java.util.function.Supplier<T>> suppliers)
microReact.react(Stream.of(()->ioCallURL1,()->ioCallURL2,()->ioCallURL3)) //each URL Supplier is an Async task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
suppliers
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> react(java.util.Collection<java.util.function.Supplier<T>> suppliers)
microReact.react(Arrays.asList(()->ioCallURL1,()->ioCallURL2,()->ioCallURL3)) //each URL Supplier is an Async task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
suppliers
- to create LazyFutureStream frompublic <T> LazyFutureStream<T> reactIterable(java.lang.Iterable<java.util.function.Supplier<T>> suppliers)
microReact.reactIterable(Arrays.asList(()->ioCallURL1,()->ioCallURL2,()->ioCallURL3)) //each URL Supplier is an Async task to be recieved on potentially different threads
.map(this::doIO) //each I/O Call can run on a separate thread, the calling thread always executes
.map(this::processResult) //map occurs on the calling thread
.forEach(System.out::println);
suppliers
- to create LazyFutureStream from