| Modifier and Type | Method and Description |
|---|---|
static <T> Valve<T> |
empty()
Returns an empty
Valve - instance, which report complete as soon as handler is registered. |
static <T> Valve<T> |
from(Flow.Publisher<T> publisher)
Creates a
Valve instance from provided Flow.Publisher. |
static Valve<ByteBuffer> |
from(InputStream stream,
int bufferCapacity)
|
static Valve<ByteBuffer> |
from(InputStream stream,
int bufferCapacity,
ExecutorService executorService)
|
static <T> Valve<T> |
from(Iterable<T> iterable)
|
static <T> Valve<T> |
from(T... t)
Creates a
Valve instance from provided array. |
@SafeVarargs public static <T> Valve<T> from(T... t)
Valve instance from provided array.
If t array parameter is null then returns an empty Valve.
T - a type of the array itemst - an array to provide as a Valvepublic static <T> Valve<T> from(Iterable<T> iterable)
Valve instance from the provided Iterable.
If iterable parameter is null then returns an empty Valve.
T - a type of iterable itemsiterable - an iterable to provide as a Valvepublic static Valve<ByteBuffer> from(InputStream stream, int bufferCapacity)
ByteBuffer based Valve instance from the provided InputStream.
Each byte buffer will have the provided capacity.
Each byte buffer uses a newly allocated memory and as such no pooling is performed.
stream - the input stream to create the Valve frombufferCapacity - the capacity of each buffer of bytespublic static Valve<ByteBuffer> from(InputStream stream, int bufferCapacity, ExecutorService executorService)
ByteBuffer based Valve instance from the provided InputStream.
Each byte buffer will have the provided capacity.
Each byte buffer uses a newly allocated memory and as such no pooling is performed.
stream - the input stream to create the Valve frombufferCapacity - the capacity of each buffer of bytesexecutorService - the executor service to use for an execution of the InputStream.read()
(and its overloads) operations that are blocking by its nature.public static <T> Valve<T> from(Flow.Publisher<T> publisher)
Valve instance from provided Flow.Publisher.
If publisher parameter is null then returns an empty Valve.
T - a type of published itemspublisher - a publisher to provide as a Valvepublic static <T> Valve<T> empty()
Valve - instance, which report complete as soon as handler is registered.
For performance reason, this particular Valve accepts any amount of handlers.
T - type of the item (which is not there :-) )Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.