public class Pipes
extends java.lang.Object
Constructor and Description |
---|
Pipes() |
Modifier and Type | Method and Description |
---|---|
static void |
clear() |
static <K,V> java.util.Optional<Adapter<V>> |
get(K key) |
static <T> java.util.Optional<org.reactivestreams.Publisher<T>> |
publisher(java.lang.Object key) |
static <T> java.util.Optional<org.reactivestreams.Publisher<T>> |
publisher(java.lang.Object key,
java.util.concurrent.Executor publishWith) |
static <T> void |
publishTo(java.lang.Object key,
org.reactivestreams.Publisher<T> publisher) |
static <T> void |
publishToAsync(java.lang.Object key,
org.reactivestreams.Publisher<T> publisher) |
static <V> void |
register(java.lang.Object key,
Adapter<V> adapter)
Register a Queue, and get back a listening LazyFutureStream that runs on a single thread
(not the calling thread)
|
static <T> void |
subscribeTo(java.lang.Object key,
org.reactivestreams.Subscriber<T> subscriber,
java.util.concurrent.Executor subscribeOn) |
public static <K,V> java.util.Optional<Adapter<V>> get(K key)
key
- : Adapter identifierpublic static <V> void register(java.lang.Object key, Adapter<V> adapter)
Pipes.register("test", QueueFactories.
<String>boundedNonBlockingQueue(100)
.build());
LazyFutureStream<String> stream = PipesToLazyStreams.cpuBoundStream("test");
stream.filter(it->it!=null).peek(System.out::println).run();
key
- : Adapter identifieradapter
- public static void clear()
public static <T> java.util.Optional<org.reactivestreams.Publisher<T>> publisher(java.lang.Object key, java.util.concurrent.Executor publishWith)
key
- for registered simple-react async.Adapterpublic static <T> java.util.Optional<org.reactivestreams.Publisher<T>> publisher(java.lang.Object key)
key
- for registered simple-react async.Adapterpublic static <T> void subscribeTo(java.lang.Object key, org.reactivestreams.Subscriber<T> subscriber, java.util.concurrent.Executor subscribeOn)
key
- for registered simple-react async.Adaptersubscriber
- Reactive Streams subscriber for data on this pipepublic static <T> void publishTo(java.lang.Object key, org.reactivestreams.Publisher<T> publisher)
key
- for registered simple-react async.Adapterpublisher
- Reactive Streams publisher to push data onto this pipepublic static <T> void publishToAsync(java.lang.Object key, org.reactivestreams.Publisher<T> publisher)
key
- for registered simple-react async.Adapterpublisher
- Reactive Streams publisher to push data onto this pipe