public class JavaslangPipes
extends java.lang.Object
| Constructor and Description |
|---|
JavaslangPipes() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clear all registered adapters & pipes from the registry
|
static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> |
futureStreamCPUBound(java.lang.Object key) |
static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> |
futureStreamIOBound(java.lang.Object key) |
static <K,V> java.util.Optional<com.aol.simple.react.async.Adapter<V>> |
get(K key) |
static <K,V> void |
register(K key,
com.aol.simple.react.async.Adapter<V> adapter)
Register specified adapter with key
|
static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> |
registerForCPU(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
Register a Queue, and get back a listening LazyFutureStream optimized for CPU Bound operations
|
static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> |
registerForIO(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
Register a Queue, and get back a listening LazyFutureStream optimized for IO Bound operations
|
static <V> javaslang.collection.Stream<V> |
registerFroSequential(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
Register a Queue, and get back a listening SequenceM
|
static <V> javaslang.collection.Stream<V> |
stream(java.lang.Object key) |
public static <K,V> java.util.Optional<com.aol.simple.react.async.Adapter<V>> get(K key)
key - : Adapter identifierpublic static <V> javaslang.collection.Stream<V> registerFroSequential(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
Stream<String> stream = JavaslangPipes.registerForSequential("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.peek(this::process)
.forEach(System.out::println);
//note that the take operator will limit items taken, but not close connection to the queue / adapter
//queue needs to be closed independently
key - : Adapter identifieradapter - public static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> registerForCPU(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
LazyFutureStream<String> stream = JavaslangPipes.registerForCPU("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.peek(this::process)
.forEach(System.out::println);
key - : Adapter identifieradapter - public static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> registerForIO(java.lang.Object key,
com.aol.simple.react.async.Adapter<V> adapter)
LazyFutureStream<String> stream = JavaslangPipes.registerForIO("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
stream.filter(it->it!=null)
.peek(this::load)
.run(System.out::println);
key - : Adapter identifieradapter - public static <V> javaslang.collection.Stream<V> stream(java.lang.Object key)
key - : Queue identifierpublic static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> futureStreamIOBound(java.lang.Object key)
key - : Queue identifierpublic static <V> com.aol.simple.react.stream.traits.LazyFutureStream<V> futureStreamCPUBound(java.lang.Object key)
key - : Queue identifierpublic static void clear()
public static <K,V> void register(K key,
com.aol.simple.react.async.Adapter<V> adapter)
key - Lookup key for adapteradapter - Adapter to register