public class PipesToEagerStreams
extends java.lang.Object
Constructor and Description |
---|
PipesToEagerStreams() |
Modifier and Type | Method and Description |
---|---|
static <V> EagerFutureStream<V> |
stream(Adapter<V> adapter) |
static <V> EagerFutureStream<V> |
streamCPUBound(Adapter<V> adapter)
Pass in a Queue, and get back a listening EagerFutureStream optimized for CPU Bound operations
Convert the EagerFutureStream to async mode to fan out operations across threads, after the first fan out operation definition
it should be converted to sync mode
|
static <V> EagerFutureStream<V> |
streamIOBound(Adapter<V> adapter)
Pass in a Queue, and get back a listening EagerFutureStream optimized for IO Bound operations
|
public static <V> EagerFutureStream<V> streamCPUBound(Adapter<V> adapter)
EagerFutureStream<String> stream = PipesToEagerStreams.registerForCPU("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.async()
.peek(this::process)
.sync()
.forEach(System.out::println);
adapter
- public static <V> EagerFutureStream<V> streamIOBound(Adapter<V> adapter)
EagerFutureStream<String> stream = Pipes.registerForIO("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.async()
.peek(this::load)
.sync()
.run(System.out::println);
adapter
- public static <V> EagerFutureStream<V> stream(Adapter<V> adapter)