public class PipesToLazyStreams
extends java.lang.Object
Constructor and Description |
---|
PipesToLazyStreams() |
Modifier and Type | Method and Description |
---|---|
static <V> LazyFutureStream<V> |
registerForCPU(java.lang.Object key,
Adapter<V> adapter)
Register a Queue, and get back a listening LazyFutureStream optimized for CPU Bound operations
Convert the LazyFutureStream 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> LazyFutureStream<V> |
registerForIO(java.lang.Object key,
Adapter<V> adapter)
Register a Queue, and get back a listening LazyFutureStream optimized for IO Bound operations
|
static <V> LazyFutureStream<V> |
stream(java.lang.Object key) |
static <V> LazyFutureStream<V> |
streamCPUBound(java.lang.Object key) |
static <V> LazyFutureStream<V> |
streamIOBound(java.lang.Object key) |
public static <V> LazyFutureStream<V> registerForCPU(java.lang.Object key, Adapter<V> adapter)
LazyFutureStream<String> stream = PipesToLazyStreams.registerForCPU("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.async()
.peek(this::process)
.sync()
.forEach(System.out::println);
key
- : Adapter identifieradapter
- public static <V> LazyFutureStream<V> registerForIO(java.lang.Object key, Adapter<V> adapter)
LazyFutureStream<String> stream = Pipes.registerForIO("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.async()
.peek(this::load)
.sync()
.run(System.out::println);
key
- : Adapter identifieradapter
- public static <V> LazyFutureStream<V> stream(java.lang.Object key)
key
- : Queue identifierpublic static <V> LazyFutureStream<V> streamIOBound(java.lang.Object key)
key
- : Queue identifierpublic static <V> LazyFutureStream<V> streamCPUBound(java.lang.Object key)
key
- : Queue identifier