public abstract class Streams
extends java.lang.Object
Streams that use a SynchronousDispatcher.| Constructor and Description |
|---|
Streams() |
| Modifier and Type | Method and Description |
|---|---|
static <T> DeferredStreamSpec<T> |
defer()
Build a deferred Stream, ready to accept values.
|
static <T> Deferred<T,Stream<T>> |
defer(Environment env)
Build a deferred Stream, ready to accept values.
|
static <T> Deferred<T,Stream<T>> |
defer(Environment env,
Dispatcher dispatcher)
Build a deferred Stream, ready to accept values.
|
static <T> Deferred<T,Stream<T>> |
defer(Environment env,
java.lang.String dispatcher)
Build a deferred Stream, ready to accept values.
|
static <T> StreamSpec<T> |
defer(java.lang.Iterable<T> values)
Build a deferred Stream that will implicitly
Deferred.accept(Object)
the given values whenever the Stream.flush() function
is invoked. |
static <T> StreamSpec<T> |
defer(Supplier<T> value)
Build a deferred Stream that will implicitly
Deferred.accept(Object)
the supplied value whenever the Stream.flush() function
is invoked. |
static <T> StreamSpec<T> |
defer(T value)
Build a deferred Stream that will implicitly
Deferred.accept(Object)
the given value whenever the Stream.flush() function
is invoked. |
static <T> Stream<T> |
on(Observable observable,
Selector acceptSelector)
Attach a Stream to the
Observable with the specified Selector. |
static <T> Stream<T> |
on(Observable observable,
Selector acceptSelector,
java.lang.Object key)
Attach a Stream to the
Observable with the specified Selector and key. |
public static <T> Deferred<T,Stream<T>> defer(Environment env)
T - the type of values passing through the Streamenv - the Reactor Environment to useDeferredpublic static <T> Deferred<T,Stream<T>> defer(Environment env, java.lang.String dispatcher)
T - the type of values passing through the Streamenv - the Reactor Environment to usedispatcher - the name of the Dispatcher to useDeferredpublic static <T> Deferred<T,Stream<T>> defer(Environment env, Dispatcher dispatcher)
T - the type of values passing through the Streamenv - the Reactor Environment to usedispatcher - the Dispatcher to useDeferredpublic static <T> DeferredStreamSpec<T> defer()
T - the type of values passing through the StreamDeferredStreamSpecpublic static <T> Stream<T> on(Observable observable, Selector acceptSelector, java.lang.Object key)
Observable with the specified Selector and key.T - the type of values passing through the Streamobservable - the Observable to observeacceptSelector - the Selector/Object tuple to listen tokey - the key to publish toDeferredStreamSpecpublic static <T> Stream<T> on(Observable observable, Selector acceptSelector)
Observable with the specified Selector.T - the type of values passing through the Streamobservable - the Observable to observeacceptSelector - the Selector/Object tuple to listen/publish toDeferredStreamSpecpublic static <T> StreamSpec<T> defer(T value)
Deferred.accept(Object)
the given value whenever the Stream.flush() function
is invoked.T - type of the valuevalue - The value to accept()DeferredStreamSpec based on the given valuepublic static <T> StreamSpec<T> defer(Supplier<T> value)
Deferred.accept(Object)
the supplied value whenever the Stream.flush() function
is invoked.T - type of the valuevalue - The value to accept()DeferredStreamSpec based on the given valuepublic static <T> StreamSpec<T> defer(java.lang.Iterable<T> values)
Deferred.accept(Object)
the given values whenever the Stream.flush() function
is invoked. If the values are a Collection the Stream's batch size will
be set to the Collection's Collection.size().T - type of the valuesvalues - The values to accept()StreamSpec based on the given values