kiss
Signal
<V
>
V
>V
The Signal
class that implements the Reactive Pattern. This class provides methods for
subscribing to the Signal
as well as delegate methods to the various observers.
In Reactive Pattern an observer subscribes to a Signal
. Then that observer reacts to
whatever item or sequence of items the Signal
emits. This pattern facilitates concurrent
operations because it does not need to block while waiting for the Signal
to emit
objects, but instead it creates a sentry in the form of an observer that stands ready to react
appropriately at whatever future time the Signal
does so.
The subscribe method is how you connect an Observer
to a Signal
. Your
Observer
implements some subset of the following methods:
Observer#accept(Object)
- A
Signal
calls this method whenever theSignal
emits an item. This method takes as a parameter the item emitted by theSignal
. Observer#error(Throwable)
- A
Signal
calls this method to indicate that it has failed to generate the expected data or has encountered some other error. It will not make further calls to
orObserver#error(Throwable)
. TheObserver#complete()
method takes as its parameter an indication of what caused the error.Observer#error(Throwable)
Observer#complete()
- A
Signal
calls this method after it has called
for the final time, if it has not encountered any errors.Observer#accept(Object)
By the terms of the Signal
contract, it may call
zero or more times, and then may follow those
calls with a call to either Observer#accept(Object)
or
Observer#complete()
but not both, which will be its last call. By
convention, in this document, calls to Observer#error(Throwable)
are usually
called “emissions” of items, whereas calls to
Observer#accept(Object)
or Observer#complete()
are
called “notifications.”
Observer#error(Throwable)
Signal
(CollectionObserverV
observers
)
CollectionObserverV
observers
)Collection observers |
A subscriber |
Create Signal
preassign the specified subscriber Collection
which will be
invoked whenever you calls #to(Observer)
related methods.
Signal
(BiFunctionObserverV
, Disposable
, Disposable
subscriber
)
BiFunctionObserverV
, Disposable
, Disposable
subscriber
)BiFunction subscriber |
A subscriber |
Create Signal
preassign the specified subscriber BiFunction
which will be
invoked whenever you calls #to(Observer)
related methods.
never
()
SignalR
R
R |
|
Signal |
For reuse.
to
(Runnable
next
)
Disposable
Runnable
next
)Runnable next |
A delegator method of |
Disposable |
Calling |
An Observer
must call an Signal#to()
method in order to receive items and
notifications from the Observable.
to
(Consumer?
V
next
)
Disposable
Consumer?
V
next
)Consumer next |
A delegator method of |
Disposable |
Calling |
An Observer
must call an Signal#to()
method in order to receive items and
notifications from the Observable.
to
(Consumer?
V
next
, ConsumerThrowable
error
)
Disposable
Consumer?
V
next
, ConsumerThrowable
error
)Consumer next |
A delegator method of |
Consumer error |
A delegator method of |
Disposable |
Calling |
An Observer
must call an Signal#to()
method in order to receive items and
notifications from the Observable.
to
(Runnable
next
, ConsumerThrowable
error
, Runnable
complete
)
Disposable
Runnable
next
, ConsumerThrowable
error
, Runnable
complete
)Runnable next |
A delegator method of |
Consumer error |
A delegator method of |
Runnable complete |
A delegator method of |
Disposable |
Calling |
Receive values from this Signal
.
to
(Consumer?
V
next
, ConsumerThrowable
error
, Runnable
complete
)
Disposable
Consumer?
V
next
, ConsumerThrowable
error
, Runnable
complete
)Consumer next |
A delegator method of |
Consumer error |
A delegator method of |
Runnable complete |
A delegator method of |
Disposable |
Calling |
Receive values from this Signal
.
to
(Observer?
V
observer
)
Disposable
Observer?
V
observer
)Observer observer |
A value observer of this |
Disposable |
Calling |
Receive values from this Signal
.
to
(ObserverV
observer
, Disposable
disposer
)
Disposable
ObserverV
observer
, Disposable
disposer
)Observer observer |
A value observer of this |
Disposable disposer |
|
Disposable |
Calling |
Receive values from this Signal
.
to
()
VariableV
V
Variable |
A |
to
(Collector?
V
, A
, R
receiver
)
R
Collector?
V
, A
, R
receiver
)A |
|
R |
|
Collector receiver |
|
R |
A |
to
(R
receiver
, WiseBiConsumerR
, V
assigner
)
R
R
receiver
, WiseBiConsumerR
, V
assigner
)R |
|
R receiver |
A value receiver. |
WiseBiConsumer assigner |
A value assigner. |
R |
A value receiver. |
Receive values from this Signal
.
toCollection
(C
collection
)
C
C
collection
)C
|
|
C collection |
|
C |
A |
Receive values as Collection
from this Signal
.
toGroup
(FunctionV
, K
keyGenerator
)
MapK
, ListV
FunctionV
, K
keyGenerator
)K
, ListV
K |
The type of the keys. |
Function keyGenerator |
The classifier function mapping input elements to keys. |
Map |
A grouping |
Groups the elements according to the classification function and returns the result in a
Map
. The classification function maps elements to some key type K. The method
produces a Map
whose keys are the values resulting from applying the classification
function to the input elements, and whose corresponding values are Lists containing the input
elements which map to the associated key under the classification function.
There are no guarantees on the type, mutability, serializability, or thread-safety of the
Map
or List
objects returned.
toList
()
ListV
V
List |
A |
toMap
(FunctionV
, Key
keyGenerator
)
MapKey
, V
FunctionV
, Key
keyGenerator
)Key
, V
Key |
|
Function keyGenerator |
A |
Map |
A |
toMap
(FunctionV
, Key
keyGenerator
, FunctionV
, Value
valueGenerator
)
MapKey
, Value
FunctionV
, Key
keyGenerator
, FunctionV
, Value
valueGenerator
)Key
, Value
Key |
|
Value |
|
Function keyGenerator |
A |
Function valueGenerator |
A |
Map |
A |
toSet
()
SetV
V
Set |
A |
all
(Predicate?
V
condition
)
SignalBoolean
Predicate?
V
condition
)Boolean
Predicate condition |
A condition that evaluates an item and returns a Boolean. |
Signal |
A new
|
Returns Signal
that emits a Boolean that indicates whether all the items emitted
by the source Signal
satisfy a condition.
any
(Predicate?
V
condition
)
SignalBoolean
Predicate?
V
condition
)Boolean
Predicate condition |
A condition to test items emitted by the source |
Signal |
A |
Returns a Signal
that emits true if any item emitted by the source Signal
satisfies a specified condition, otherwise false. Note: this always emits false if the source
Signal
is empty.
as
(Class?
R
type
)
SignalR
Class?
R
type
)R
R |
|
Class type |
The type of result. |
Signal |
A new
|
Filters the values of an Signal
sequence based on the specified type.
buffer
()
SignalListV
ListV
Signal |
A new
|
It accumulates all the elements and flows them together as List
buffer upon
completion.
ββββ ββββ‘ββββ’βββ β β β β βββββββββββββββ buffer (all) βββββββββββββββ β ββββββββββββ[β β‘β’]β
buffer
(int
size
)
SignalListV
int
size
)ListV
int size |
A length of each buffer. |
Signal |
A new
|
It accumulates elements, and whenever it reaches the specified size, it flows them together
as List
buffer. Note that if the elements have not accumulated to the specified size
at the time of completion, they will all be discarded.
ββββ ββ‘ββ’ββ£ββ€ββ₯ββ¦β β β β β β β β ββββββββββββββββ buffer (3) ββββββββββββββββ β β ββββββ[β β‘β’]ββ[β£β€β₯]ββ
buffer
(int
size
, int
interval
)
SignalListV
int
size
, int
interval
)ListV
int size |
A length of each buffer. Zero or negative number are treated exactly the same way as 1. |
int interval |
A number of values to skip between creation of consecutive buffers. Zero or negative number are treated exactly the same way as 1. |
Signal |
A new
|
It accumulates elements at the specified intervals, and whenever it reaches the specified
size, it flows them together as List
buffer. Note that if the elements have not
accumulated to the specified size at the time of completion, they will all be discarded.
ββββ ββββ‘ββββ’ββββ£ββββ€ββ β β β β β βββββββββββββββββββββ buffer (2, 1) βββββββββββββββββββββ β β β β βββββββ[β β‘]β[β‘β’]β[β’β£]β[β£β€]ββ
buffer
(Signal
timing
)
SignalListV
Signal
timing
)ListV
Signal timing |
A timing |
Signal |
A new
|
It accumulates elements and flows them together as List
buffer at each specified
timing. Note that all unflowed accumulated elements at the time of completion will be
discarded.
βββββββββ½βββββββββββ½ββ timing β β ββββ βββ‘βββββ’βββββ£β€ββββ signal β β β ββ βββββββββββββββββββββ buffer (timing) βββββββββββββββββββββ β β βββββββ[β β‘]ββββββββ[β’β£β€]β
combine
(SignalO
other
)
Signalβ
‘V
, O
SignalO
other
)β
‘V
, O
O |
|
Signal other |
Another |
Signal |
A |
It flows the pair of each elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in every signals.
ββββ β‘βββββββ’ββββββ£β€βββ signal ββ β ββ ββββββΆββββ·βββΈβββΉββββββ other β β β β βββββββββββββββββββββ combine (other) βββββββββββββββββββββ β β β β βββββ[β βΆ]β[β‘β·]β[β’βΈ]ββ[β£βΉ]βββ
combine
(SignalO
other
, SignalA
another
)
Signalβ
’V
, O
, A
SignalO
other
, SignalA
another
)β
’V
, O
, A
O |
|
A |
|
Signal other |
Another |
Signal another |
An another |
Signal |
A |
It flows the pair of each elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in every signals.
ββββ β‘βββββββ’ββββββ£β€βββ signal ββ β ββ ββββββΆββββ·βββΈβββΉββββββ other β β β β βββΆββββββββ·βββββββββΈββ another β β β βββββββββββββββββββββ combine (other, another) βββββββββββββββββββββ β β β ββββ[β βΆβΆ]β[β‘β·β·]βββββ[β’βΈβΈ]ββ
combine
(SignalO
other
, BiFunctionV
, O
, R
combiner
)
SignalR
SignalO
other
, BiFunctionV
, O
, R
combiner
)R
O |
|
R |
|
Signal other |
Another |
BiFunction combiner |
An aggregation function used to combine the items emitted by the source
|
Signal |
A |
It flows the pair of each elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in every signals.
ββββ β‘βββββββ’ββββββ£β€ββ signal ββ β ββ βββββββββββββββββββββ other β β β β ββββββββββββββββββββ combine (other, a and b) ββββββββββββββββββββ β β β β ββββββ ββββ·βββ·βββββΉβββ
combine
(SignalV
others
, BinaryOperatorV
operator
)
SignalV
SignalV
others
, BinaryOperatorV
operator
)V
Signal others |
Other |
BinaryOperator operator |
A function that, when applied to an item emitted by each of the source
|
Signal |
A |
It flows the pair of each elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in every signals.
ββββ β‘βββββββ’ββββββ£β€ββ signal ββ β ββ βββββββββββββββββββββ other β β β β ββββββββββββββββββββ combine (other, a and b) ββββββββββββββββββββ β β β β ββββββ ββββ·βββ·βββββΉβββ
combineLatest
(SignalO
other
)
Signalβ
‘V
, O
SignalO
other
)β
‘V
, O
O |
|
Signal other |
Another |
Signal |
An |
It flows the pair of each latest elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in any signal.
ββββ β‘ββββββββ’ββββ£βββ signal ββ β β ββββββΆββββ·ββββββββββ other β β βββββββββββββββββββ combineLatest (other) βββββββββββββββββββ β β β β ββββ[β‘βΆ]β[β‘β·]β[β’β·]β[β£β·]βββ
combineLatest
(SignalO
other
, SignalA
another
)
Signalβ
’V
, O
, A
SignalO
other
, SignalA
another
)β
’V
, O
, A
O |
|
A |
|
Signal other |
Another |
Signal another |
An another |
Signal |
An |
It flows the pair of each latest elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in any signal.
ββββ β‘ββββββββββ’βββββββ signal ββ β ββββββΆβββββ·βββββββββββ other β β βββΆβββββββββββββββββ·ββ another β β βββββββββββββββββββββ combineLatest (other, another) βββββββββββββββββββββ β β β β ββββ[β‘βΆβΆ]β[β‘β·βΆ]β[β’β·βΆ]β[β’β·β·]β
combineLatest
(SignalO
other
, BiFunctionV
, O
, R
function
)
SignalR
SignalO
other
, BiFunctionV
, O
, R
function
)R
O |
|
R |
|
Signal other |
Another |
BiFunction function |
An aggregation function used to combine the items emitted by the source
|
Signal |
An |
It flows the pair of each latest elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in any signal.
ββββ β‘ββββββββ’ββββ£βββ signal ββ β β ββββββββββββββββββββ other β β β βββββββββββββββββββ combineLatest (other, A and B) βββββββββββββββββββ β β β ββ ββββββΆββββ·βββΈβββ’β£ββ
combineLatest
(SignalV
others
, BinaryOperatorV
operator
)
SignalV
SignalV
others
, BinaryOperatorV
operator
)V
Signal others |
Other |
BinaryOperator operator |
An aggregation function used to combine the items emitted by the source
|
Signal |
An |
It flows the pair of each latest elements coming from all signals. In order to flow a new pair, there must be at least one or more unflowed elements in any signal.
ββββ β‘ββββββββ’ββββ£βββ signal ββ β β ββββββββββββββββββββ other β β β βββββββββββββββββββ combineLatest (others, A and B) βββββββββββββββββββ β β β ββ ββββββΆββββ·βββΈβββ’β£βββ
concat
(Signal?
V
others
)
SignalV
Signal?
V
others
)V
Signal others |
A sequence of |
Signal |
A new
|
Start the specified signal after the current signal is completed.
ββββ β‘βββ’βββ signal ββ β β ββ£ββββ€β₯ββ other β ββ β βββββββββββββββββββ concat (other) βββββββββββββββββββ ββ β β ββ ββββ β‘βββ’ββββ£ββββ€β₯ββ
concat
(IterableSignal?
V
others
)
SignalV
IterableSignal?
V
others
)V
Iterable others |
A sequence of |
Signal |
A new
|
Start the specified signal after the current signal is completed.
ββββ β‘βββ’βββ signal ββ β β ββ£ββββ€β₯ββ other β ββ β βββββββββββββββββββ concat (other) βββββββββββββββββββ ββ β β ββ ββββ β‘βββ’ββββ£ββββ€β₯ββ
concatMap
(WiseFunctionV
, SignalR
function
)
SignalR
WiseFunctionV
, SignalR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the current
|
Signal |
A new
|
Returns a new Signal
that emits items resulting from applying a function that you
supply to each item emitted by the current Signal
, where that function returns an
Signal
, and then emitting the items that result from concatenating those returned
Signal
.
count
()
SignalLong
Long
Signal |
Signal that emits a single item: the number of items emitted by the source
Signal as a 64-bit Long item |
Returns a Signal
that counts the total number of items emitted by the source
Signal
and emits this count as a 64-bit Long.
debounce
(long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalV
long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)V
long time |
A time value. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A time unit. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Drops values that are followed by newer values before a timeout. The timer resets on each value emission.
debounce
(long
time
, TimeUnit
unit
, boolean
acceptFirst
, ScheduledExecutorService
scheduler
)
SignalV
long
time
, TimeUnit
unit
, boolean
acceptFirst
, ScheduledExecutorService
scheduler
)V
long time |
A time value. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A time unit. |
boolean acceptFirst |
Determines whether to pass the first element or not. It is useful to get the beginning and end of a sequence of events. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Drops values that are followed by newer values before a timeout. The timer resets on each value emission.
debounce
(VariableLong
time
, TimeUnit
unit
, boolean
acceptFirst
, ScheduledExecutorService
scheduler
)
SignalV
VariableLong
time
, TimeUnit
unit
, boolean
acceptFirst
, ScheduledExecutorService
scheduler
)V
Variable time |
A time value. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A time unit. |
boolean acceptFirst |
Determines whether to pass the first element or not. It is useful to get the beginning and end of a sequence of events. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Drops values that are followed by newer values before a timeout. The timer resets on each value emission.
debounceAll
(long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalListV
long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)ListV
long time |
A time value. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A time unit. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Collect values that are followed by newer values before a timeout. The timer resets on each value emission.
debounceAll
(VariableLong
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalListV
VariableLong
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)ListV
Variable time |
A time value. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A time unit. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Collect values that are followed by newer values before a timeout. The timer resets on each value emission.
delay
(long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalV
long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)V
long time |
The delay to shift the source by. |
TimeUnit unit |
The |
ScheduledExecutorService scheduler |
An event scheduler. |
Signal |
The source |
Returns Signal
that emits the items emitted by the source Signal
shifted
forward in time by a specified delay at parallel thread. Error notifications from the source
Signal
are not delayed.
delay
(Duration
time
, ScheduledExecutorService
scheduler
)
SignalV
Duration
time
, ScheduledExecutorService
scheduler
)V
Duration time |
The delay to shift the source by. |
ScheduledExecutorService scheduler |
|
Signal |
The source |
Returns Signal
that emits the items emitted by the source Signal
shifted
forward in time by a specified delay at parallel thread. Error notifications from the source
Signal
are not delayed.
delay
(FunctionV
, Duration
time
, ScheduledExecutorService
scheduler
)
SignalV
FunctionV
, Duration
time
, ScheduledExecutorService
scheduler
)V
Function time |
The delay to shift the source by. |
ScheduledExecutorService scheduler |
|
Signal |
The source |
Returns Signal
that emits the items emitted by the source Signal
shifted
forward in time by a specified delay at parallel thread. Error notifications from the source
Signal
are not delayed.
diff
()
SignalV
V
Signal |
Signal that emits those items from the source Signal that are
distinct from their immediate predecessors. |
Returns an Signal
that emits all items emitted by the source Signal
that are
distinct from their immediate predecessors based on Object#equals(Object)
comparison.
It is recommended the elements' class V
in the flow overrides the default
Object.equals()
to provide meaningful comparison between items as the default Java
implementation only considers reference equivalence. Alternatively, use the
#diff(BiPredicate)
overload and provide a comparison function in case the class
V
can't be overridden preassign custom equals()
or the comparison itself
should happen on different terms or properties of the class V
.
diff
(BiPredicateV
, V
compare
)
SignalV
BiPredicateV
, V
compare
)V
BiPredicate compare |
The function that receives the previous item and the current item and is expected to return true if the two are equal, thus skipping the current value. |
Signal |
Signal that emits those items from the source Signal that are
distinct from their immediate predecessors. |
Returns an Signal
that emits all items emitted by the source Signal
that are
distinct from their immediate predecessors when compared preassign each other via the
provided comparator function.
distinct
()
SignalV
V
Signal |
A new
|
Returns an Signal
consisting of the distinct values (according to
Object#equals(Object)
) of this stream.
distinct
(WiseFunctionV
, ?
keySelector
)
SignalV
WiseFunctionV
, ?
keySelector
)V
WiseFunction keySelector |
|
Signal |
A new
|
Returns an Signal
consisting of the distinct values (according to
Object#equals(Object)
) of this stream.
effect
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#accept(Object)
.
effect
(WiseConsumer?
V
effect
)
SignalV
WiseConsumer?
V
effect
)V
WiseConsumer effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#accept(Object)
.
effectAfter
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#accept(Object)
.
effectAfter
(WiseConsumer?
V
effect
)
SignalV
WiseConsumer?
V
effect
)V
WiseConsumer effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#accept(Object)
.
effectOnce
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke only once when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect only once when it calls
Observer#accept(Object)
.
effectOnce
(WiseConsumer?
V
effect
)
SignalV
WiseConsumer?
V
effect
)V
WiseConsumer effect |
The action to invoke only once when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect only once when it calls
Observer#accept(Object)
.
effectOnComplete
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#complete()
.
effectOnDispose
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Disposable#dispose()
.
effectOnError
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#error(Throwable)
.
effectOnError
(WiseConsumerThrowable
effect
)
SignalV
WiseConsumerThrowable
effect
)V
WiseConsumer effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#error(Throwable)
.
effectOnLifecycle
(WiseFunctionDisposable
, WiseConsumerV
effect
)
SignalV
WiseFunctionDisposable
, WiseConsumerV
effect
)V
WiseFunction effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#accept(Object)
.
effectOnObserve
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The |
Signal |
The source |
Modifies the source Signal
so that it invokes the given effect when it is observed
from its observers. Each observation will result in an invocation of the given action except
when the source Signal
is reference counted, in which case the source Signal
will invoke the given action for the first observation.
effectOnObserve
(WiseConsumer?
Disposable
effect
)
SignalV
WiseConsumer?
Disposable
effect
)V
WiseConsumer effect |
The |
Signal |
The source |
Modifies the source Signal
so that it invokes the given effect when it is observed
from its observers. Each observation will result in an invocation of the given action except
when the source Signal
is reference counted, in which case the source Signal
will invoke the given action for the first observation.
effectOnTerminate
(WiseRunnable
effect
)
SignalV
WiseRunnable
effect
)V
WiseRunnable effect |
The action to invoke when the source |
Signal |
The source |
Modifies the source Signal
so that it invokes an effect when it calls
Observer#error(Throwable)
or Observer#complete()
.
first
()
SignalV
V
Signal |
A new
|
Returns Signal
that emits only the very first item emitted by the source
Signal
, or completes if the source Signal
is empty.
flatArray
(WiseFunctionV
, R
function
)
SignalR
WiseFunctionV
, R
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
flatIterable
(WiseFunctionV
, ?
IterableR
function
)
SignalR
WiseFunctionV
, ?
IterableR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
flatMap
(WiseFunctionV
, SignalR
function
)
SignalR
WiseFunctionV
, SignalR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
flatMap
(SupplierC
context
, WiseBiFunctionC
, V
, SignalR
function
)
SignalR
SupplierC
context
, WiseBiFunctionC
, V
, SignalR
function
)R
C |
|
R |
|
Supplier context |
|
WiseBiFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
flatVariable
(WiseFunctionV
, VariableR
function
)
SignalR
WiseFunctionV
, VariableR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
index
(long
start
)
Signalβ
‘V
, Long
long
start
)β
‘V
, Long
long start |
A starting index number. |
Signal |
A new
|
Append index (starting from the specified value).
interval
(long
interval
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalV
long
interval
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)V
long interval |
Time to emit values. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A unit of time for the specified interval. |
ScheduledExecutorService scheduler |
|
Signal |
A new
|
Ensure the interval time for each values in Signal
sequence.
is
(Predicate?
V
condition
)
SignalBoolean
Predicate?
V
condition
)Boolean
Predicate condition |
A conditional function to apply to each value emitted by this
|
Signal |
A new
|
Returns an Signal
that applies the given Predicate
function to each value
emitted by an Signal
and emits the result.
isNot
(Predicate?
V
condition
)
SignalBoolean
Predicate?
V
condition
)Boolean
Predicate condition |
A conditional function to apply to each value emitted by this
|
Signal |
A new
|
Returns an Signal
that applies the given Predicate
function to each value
emitted by an Signal
and emits the result.
isCompleted
()
SignalBoolean
Boolean
Signal |
A |
Returns Signal
that emits true
that indicates whether the source
Signal
is completed.
isEmitted
()
SignalBoolean
Boolean
Signal |
A |
Returns Signal
that emits true
that indicates whether the source
Signal
emits any value.
isEmpty
()
SignalBoolean
Boolean
Signal |
A |
Returns Signal
that emits true
that indicates whether the source
Signal
is completed preassignout any value emitted.
isErred
()
SignalBoolean
Boolean
Signal |
Returns Signal
that emits true
that indicates whether the source
Signal
is erred.
isSignaled
()
SignalBoolean
Boolean
Signal |
A |
Returns Signal
that emits true
that indicates whether the source
Signal
is emitted, erred or completed.
isTerminated
()
SignalBoolean
Boolean
Signal |
A |
Returns Signal
that emits true
that indicates whether the source
Signal
is erred or completed.
joinAll
(WiseFunctionV
, R
function
, ExecutorService
executor
)
SignalR
WiseFunctionV
, R
function
, ExecutorService
executor
)R
R |
|
WiseFunction function |
A mapper function. |
ExecutorService executor |
|
Signal |
A new
|
Returns a new Signal
that invokes the mapper action in parallel thread and waits all
of them until all actions are completed.
joinAllOrNone
(WiseFunctionV
, R
function
, ExecutorService
executor
)
SignalR
WiseFunctionV
, R
function
, ExecutorService
executor
)R
R |
|
WiseFunction function |
The task mapper function. |
ExecutorService executor |
|
Signal |
A new
|
Executes all tasks in parallel and returns their results only if all succeed. If any task fails, all remaining tasks are cancelled and the exception is propagated.
joinAny
(WiseFunctionV
, R
function
, ExecutorService
executor
)
SignalR
WiseFunctionV
, R
function
, ExecutorService
executor
)R
R |
|
WiseFunction function |
A mapper function. |
ExecutorService executor |
|
Signal |
A new
|
Returns a new Signal
that invokes the mapper action in parallel thread and waits
until any single action is completed. All other actions will be cancelled.
keyMap
(WiseFunctionV
, SignalR
function
)
SignalMapV
, R
WiseFunctionV
, SignalR
function
)MapV
, R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
last
()
SignalV
V
Signal |
A new
|
Returns a Signal
that emits the last item emitted by this Signal
or completes
if this Signal
is empty.
map
(WiseFunction?
V
, R
function
)
SignalR
WiseFunction?
V
, R
function
)R
R |
|
WiseFunction function |
A converter function to apply to each value emitted by this |
Signal |
A new
|
Returns an Signal
that applies the given function to each value emitted by an
Signal
and emits the result.
ββββ ββββ‘ββββ’ββββ£ββββ€βββΌ β β β β β β ββββββββββββββββββββββ map βββ ββββββββββββββββββββββ β β β β β β ββββΆββββ·ββββΈββββΉββββΊβββΌ
map
(SupplierC
context
, WiseBiFunctionC
, ?
V
, R
function
)
SignalR
SupplierC
context
, WiseBiFunctionC
, ?
V
, R
function
)R
C |
|
R |
|
Supplier context |
|
WiseBiFunction function |
A converter function to apply to each value emitted by this |
Signal |
A new
|
#map(WiseFunction)
preassign context.
ββββ ββββ‘ββββ’ββββ£ββββ€βββΌ β β β β β ββββββββββββββββββββββ map βββ ββββββββββββββββββββββ β β β β β β ββββΆββββ·ββββΈββββΉββββΊβββΌ
mapError
(WiseFunctionThrowable
, Throwable
function
)
SignalV
WiseFunctionThrowable
, Throwable
function
)V
WiseFunction function |
|
Signal |
mapTo
(R
constant
)
SignalR
R
constant
)R
R |
|
R constant |
A constant to apply to each value emitted by this |
Signal |
A new
|
Returns an Signal
that applies the given constant to each item emitted by an
Signal
and emits the result.
merge
(Signal?
V
others
)
SignalV
Signal?
V
others
)V
Signal others |
A target |
Signal |
A new
|
Flattens a sequence of Signal
emitted by an Signal
into one Signal
,
preassignout any transformation.
ββββ ββββ‘ββββ’ββββ£ββββ€βββΌ β β β β β ββββββΆβββββ·βββββΈβββββΌ β β β ββββββββββββββββββββββ merge ββββββββββββββββββββββ β β β ββ β β β ββββ ββΆββ‘βββ·β’ββββ£βΈβββ€βββΌ
merge
(IterableSignal?
V
others
)
SignalV
IterableSignal?
V
others
)V
Iterable others |
A target |
Signal |
A new
|
Flattens a sequence of Signal
emitted by an Signal
into one Signal
,
preassignout any transformation.
on
(ConsumerRunnable
scheduler
)
SignalV
ConsumerRunnable
scheduler
)V
Consumer scheduler |
A new context |
Signal |
A new
|
Switch event stream context.
ββββ ββββ‘ββββ’ββββ£ββββ€βββΌ β β β β β ββββββββββββββββββββββ on β ββββββββββββββββββββββ β β β β β β ββββΆββββ·ββββΈββββΉββββΊβββ
or
(V
value
)
SignalV
V
value
)V
V value |
|
Signal |
A new
|
Generates an Signal
sequence that guarantee one item at least.
or
(SupplierV
value
)
SignalV
SupplierV
value
)V
Supplier value |
|
Signal |
A new
|
Generates an Signal
sequence that guarantee one item at least.
or
(SignalV
values
)
SignalV
SignalV
values
)V
Signal values |
|
Signal |
A new
|
Generates an Signal
sequence that guarantee one item at least.
plug
(FunctionSignalV
, SignalO
plug
)
SignalO
FunctionSignalV
, SignalO
plug
)O
O |
An output type. |
Function plug |
A chain builder to insert. |
Signal |
A chained |
Helps to insert Signal
chain from outside.
recurse
(WiseFunctionV
, V
recurse
, Executor
executor
)
SignalV
WiseFunctionV
, V
recurse
, Executor
executor
)V
WiseFunction recurse |
A mapper function to enumerate values recursively. |
Executor executor |
An execution context. |
Signal |
A new
|
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
recurseMap
(WiseFunctionSignalV
, SignalV
recurse
, Executor
executor
)
SignalV
WiseFunctionSignalV
, SignalV
recurse
, Executor
executor
)V
WiseFunction recurse |
A mapper function to enumerate values recursively. |
Executor executor |
An execution context. |
Signal |
A new
|
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging those resulting Signal
and emitting the results of this merger.
recover
(V
value
)
SignalV
V
value
)V
V value |
A value to replace error. |
Signal |
Chainable API |
Recover the source Signal
on the specified error by the specified value. Unspecified
error types will pass through the source Signal
.
recover
(WiseFunctionSignalE
, SignalV
flow
)
SignalV
WiseFunctionSignalE
, SignalV
flow
)V
E
|
|
WiseFunction flow |
An error notifier to define recovering flow. |
Signal |
Chainable API |
Recover the source Signal
on the specified error by the notifier emitting values.
Unspecified errors will pass through the source Signal
.
- Next - Replace source error and propagate values to source signal.
- Error - Propagate to source error and dispose them.
- Complete - Terminate notifier signal. Source signal will never recover errors.
repeat
()
SignalV
V
Signal |
A new
|
Generates an Signal
sequence that repeats the given value infinitely.
repeat
(WiseFunctionSignal?
, Signal?
flow
)
SignalV
WiseFunctionSignal?
, Signal?
flow
)V
WiseFunction flow |
A receives an |
Signal |
Chainable API |
Returns an Signal
that emits the same values as the source signal preassign the
exception to an Observer#error(Throwable)
. An error notification from the source will
result in the emission of a Throwable item to the Signal
provided as an argument to
the notificationHandler function. If that Signal
calls Observer#complete()
or
Observer#error(Throwable)
then retry will call Observer#complete()
or
Observer#error(Throwable)
on the child subscription. Otherwise, this Signal
will resubscribe to the source Signal
.
retry
()
SignalV
V
Signal |
A new
|
Retry the source Signal
infinitely whenever any error is occurred.
retry
(WiseFunctionSignalE
, Signal?
flow
)
SignalV
WiseFunctionSignalE
, Signal?
flow
)V
E
|
|
WiseFunction flow |
An error notifier to define retrying flow. |
Signal |
Chainable API |
Retry the source Signal
when the specified error is occurred. Unspecified errors will
pass through the source Signal
.
- Next - Retry source
Signal
. - Error - Propagate to source error and dispose them.
- Complete - Terminate notifier signal. Source signal will never retry errors.
reverse
()
SignalV
V
Signal |
A new
|
Buffer all values until complete, then all buffered values are emitted in descending order.
sample
(Signal?
sampler
)
SignalV
Signal?
sampler
)V
Signal sampler |
|
Signal |
A new
|
Returns an Signal
that, when the specified sampler Signal
emits an item,
emits the most recently emitted item (if any) emitted by the source Signal
since the
previous emission from the sampler Signal
.
scan
(Collector?
V
, A
, R
collector
)
SignalR
Collector?
V
, A
, R
collector
)R
A |
|
R |
|
Collector collector |
An accumulator function to be invoked on each item emitted by the source
|
Signal |
An |
Returns an Signal
that applies a function of your choosing to the first item emitted
by a source Signal
and a seed value, then feeds the result of that function along
preassign the second item emitted by the source Signal
into the same function, and so
on until all items have been emitted by the source Signal
, emitting the result of
each of these iterations.
scan
(SupplierR
init
, WiseBiFunctionR
, V
, R
function
)
SignalR
SupplierR
init
, WiseBiFunctionR
, V
, R
function
)R
R |
|
Supplier init |
An initial (seed) accumulator item. |
WiseBiFunction function |
An accumulator function to be invoked on each item emitted by the source
|
Signal |
An |
Returns an Signal
that applies a function of your choosing to the first item emitted
by a source Signal
and a seed value, then feeds the result of that function along
preassign the second item emitted by the source Signal
into the same function, and so
on until all items have been emitted by the source Signal
, emitting the result of
each of these iterations.
scan
(WiseFunctionV
, R
first
, WiseBiFunctionR
, V
, R
others
)
SignalR
WiseFunctionV
, R
first
, WiseBiFunctionR
, V
, R
others
)R
R |
|
WiseFunction first |
An accumulator which process only first value. |
WiseBiFunction others |
An accumulator function to be invoked on each item emitted by the source
|
Signal |
An |
Returns an Signal
that applies a function of your choosing to the first item emitted
by a source Signal
and a seed value, then feeds the result of that function along
preassign the second item emitted by the source Signal
into the same function, and so
on until all items have been emitted by the source Signal
, emitting the result of
each of these iterations.
sequenceMap
(WiseFunctionV
, SignalR
function
)
SignalR
WiseFunctionV
, SignalR
function
)R
R |
|
WiseFunction function |
A function that maps a sequence of values into a sequence of |
Signal |
A new
|
Maps a sequence of values into Signal
and concatenates these Signal
eagerly
into a single Signal
. Eager concatenation means that once a subscriber subscribes,
this operator subscribes to all the source Signal
. The operator buffers the values
emitted by these Signal
and then drains them in order, each one after the previous
one completes.
skip
(long
count
)
SignalV
long
count
)V
long count |
A number of values to skip. Zero or negative number will ignore this instruction. |
Signal |
A new
|
Bypasses a specified number of values in an Signal
sequence and then returns the
remaining values.
skip
(V
excludes
)
SignalV
V
excludes
)V
V excludes |
A collection of skip items. |
Signal |
A new
|
Alias for skip(I.set(excludes)).
skip
(Predicate?
V
condition
)
SignalV
Predicate?
V
condition
)V
Predicate condition |
A skip condition. |
Signal |
A new
|
Alias for take(condition.negate()).
skip
(V
init
, BiPredicate?
V
, ?
V
condition
)
SignalV
V
init
, BiPredicate?
V
, ?
V
condition
)V
V init |
|
BiPredicate condition |
A skip condition. |
Signal |
A new
|
Alias for take(init, condition.negate()).
skip
(SupplierC
contextSupplier
, BiPredicateC
, ?
V
condition
)
SignalV
SupplierC
contextSupplier
, BiPredicateC
, ?
V
condition
)V
C |
|
Supplier contextSupplier |
|
BiPredicate condition |
A condition function to apply to each value emitted by this |
Signal |
A new
|
#skip(Predicate)
preassign context.skip
(SignalBoolean
condition
)
SignalV
SignalBoolean
condition
)V
Signal condition |
An external boolean |
Signal |
A new
|
Returns an Signal
consisting of the values of this Signal
that match the
given predicate.
skipAt
(LongPredicate
condition
)
SignalV
LongPredicate
condition
)V
LongPredicate condition |
An index condition of values to emit. |
Signal |
A new
|
Returns a specified index values from the start of an Signal
sequence.
skipIf
(FunctionV
, Signal?
condition
)
SignalV
FunctionV
, Signal?
condition
)V
Function condition |
A function that evaluates an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items emitted by the source Signal
, checks the
specified predicate for each item, and then completes if the condition is not signaled.
skipError
(Class?
Throwable
types
)
SignalV
Class?
Throwable
types
)V
Class types |
A list of error types to ignore. |
Signal |
Signal which ignores the specified error. |
Return the Signal
which ignores the specified error.
skipComplete
()
SignalV
V
Signal |
Signal which ignores complete event. |
Return the Signal
which ignores complete event.
skipNull
()
SignalV
V
Signal |
A new
|
Alias for skip(Objects::isNull).
skipUntil
(Predicate?
V
predicate
)
SignalV
Predicate?
V
predicate
)V
Predicate predicate |
A function to test each item emitted from the source |
Signal |
An |
Returns an Signal
that skips all items emitted by the source Signal
as long
as a specified condition holds true, but emits all further source items as soon as the
condition becomes false.
skipUntil
(Signal
timing
)
SignalV
Signal
timing
)V
Signal timing |
The second |
Signal |
An |
Returns the values from the source Signal
sequence only after the other
Signal
sequence produces a value.
skipWhile
(Predicate?
V
predicate
)
SignalV
Predicate?
V
predicate
)V
Predicate predicate |
A function to test each item emitted from the source |
Signal |
An |
Returns an Signal
that skips all items emitted by the source Signal
as long
as a specified condition holds true, but emits all further source items as soon as the
condition becomes false.
sort
(Comparator?
V
comparator
)
SignalV
Comparator?
V
comparator
)V
Comparator comparator |
|
Signal |
A new
|
Buffer all items until complete event and then sorted items will be emitted sequentially.
startWith
(V
values
)
SignalV
V
values
)V
V values |
The values that contains the items you want to emit first. |
Signal |
A new
|
Emit a specified sequence of items before beginning to emit the items from the source
Signal
.
If you want an Signal
to emit a specific sequence of items before it begins emitting
the items normally expected from it, apply the StartWith operator to it.
If, on the other hand, you want to append a sequence of items to the end of those normally
emitted by an Signal
, you want the #sequenceMap(WiseFunction)
operator.
startWith
(SupplierV
value
)
SignalV
SupplierV
value
)V
Supplier value |
The values that contains the items you want to emit first. |
Signal |
A new
|
Emit a specified sequence of items before beginning to emit the items from the source
Signal
.
If you want an Signal
to emit a specific sequence of items before it begins emitting
the items normally expected from it, apply the StartWith operator to it.
If, on the other hand, you want to append a sequence of items to the end of those normally
emitted by an Signal
, you want the #sequenceMap(WiseFunction)
operator.
startWith
(IterableV
values
)
SignalV
IterableV
values
)V
Iterable values |
The values that contains the items you want to emit first. |
Signal |
A new
|
Emit a specified sequence of items before beginning to emit the items from the source
Signal
.
If you want an Signal
to emit a specific sequence of items before it begins emitting
the items normally expected from it, apply the StartWith operator to it.
If, on the other hand, you want to append a sequence of items to the end of those normally
emitted by an Signal
, you want the #sequenceMap(WiseFunction)
operator.
startWith
(SignalV
values
)
SignalV
SignalV
values
)V
Signal values |
The initial values. |
Signal |
A new
|
Emit a specified sequence of items before beginning to emit the items from the source
Signal
.
startWithNull
()
SignalV
V
Signal |
A new
|
Emit null
item before beginning to emit the items from the source Signal
.
stopError
(Class?
Throwable
types
)
SignalV
Class?
Throwable
types
)V
Class types |
A list of error types to replace. |
Signal |
Signal which replaces the specified error by complete event. |
Return the Signal
which replaces the specified error by complete event.
subscribeOn
(ConsumerRunnable
scheduler
)
SignalV
ConsumerRunnable
scheduler
)V
Consumer scheduler |
You specify which scheduler this operator will use. |
Signal |
A new
|
Asynchronously subscribes Observer
to this Signal
on the specified scheduler.
switchMap
(WiseFunctionV
, SignalR
function
)
SignalR
WiseFunctionV
, SignalR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging the latest resulting Signal
and emitting the results of this
merger.
switchVariable
(WiseFunctionV
, VariableR
function
)
SignalR
WiseFunctionV
, VariableR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items based on applying a function that you supply to
each item emitted by the source Signal
, where that function returns an Signal
, and then merging the latest resulting Signal
and emitting the results of this
merger.
switchOff
(SignalBoolean
timing
)
SignalV
SignalBoolean
timing
)V
Signal timing |
A timing whether the |
Signal |
A new
|
Return an Signal
that is observed as long as the specified timing Signal
indicates false. When the timing Signal
returns true, the currently subscribed
Signal
is immediately disposed.
switchOn
(SignalBoolean
timing
)
SignalV
SignalBoolean
timing
)V
Signal timing |
A timing whether the |
Signal |
A new
|
Return an Signal
that is observed as long as the specified timing Signal
indicates true. When the timing Signal
returns false, the currently subscribed
Signal
is immediately disposed.
take
(long
count
)
SignalV
long
count
)V
long count |
A number of values to emit. Zero or negative number will ignore this instruction. |
Signal |
A new
|
Returns a specified number of contiguous values from the start of an Signal
sequence.
take
(V
includes
)
SignalV
V
includes
)V
V includes |
A collection of take items. |
Signal |
A new
|
Alias for take(I.set(includes)).
take
(Predicate?
V
condition
)
SignalV
Predicate?
V
condition
)V
Predicate condition |
A function that evaluates the values emitted by the source |
Signal |
A new
|
Returns an Signal
consisting of the values of this Signal
that match the
given predicate.
take
(V
init
, BiPredicate?
V
, ?
V
condition
)
SignalV
V
init
, BiPredicate?
V
, ?
V
condition
)V
V init |
|
BiPredicate condition |
A function that evaluates the values emitted by the source |
Signal |
A new
|
Returns an Signal
consisting of the values of this Signal
that match the
given predicate.
take
(SupplierC
contextSupplier
, BiPredicateC
, ?
V
condition
)
SignalV
SupplierC
contextSupplier
, BiPredicateC
, ?
V
condition
)V
C |
|
Supplier contextSupplier |
|
BiPredicate condition |
A condition function to apply to each value emitted by this |
Signal |
A new
|
#take(Predicate)
preassign context.take
(SignalBoolean
condition
)
SignalV
SignalBoolean
condition
)V
Signal condition |
An external boolean |
Signal |
A new
|
Returns an Signal
consisting of the values of this Signal
that match the
given predicate.
takeAt
(LongPredicate
condition
)
SignalV
LongPredicate
condition
)V
LongPredicate condition |
An index condition of values to emit. |
Signal |
A new
|
Returns a specified index values from the start of an Signal
sequence.
takeIf
(FunctionV
, Signal?
condition
)
SignalV
FunctionV
, Signal?
condition
)V
Function condition |
A function that evaluates an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items emitted by the source Signal
, checks the
specified predicate for each item, and then completes if the condition is signaled.
takeUntil
(Predicate?
V
condition
)
SignalV
Predicate?
V
condition
)V
Predicate condition |
A function that evaluates an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items emitted by the source Signal
, checks the
specified predicate for each item, and then completes if the condition is satisfied.
takeUntil
(Signal
timing
)
SignalV
Signal
timing
)V
Signal timing |
A |
Signal |
A |
Returns Signal
that emits the items emitted by the source Signal
until a
second Signal
emits an item.
takeWhile
(Predicate?
V
condition
)
SignalV
Predicate?
V
condition
)V
Predicate condition |
A function that evaluates an item emitted by the source |
Signal |
An |
Returns an Signal
that emits items emitted by the source Signal
, checks the
specified predicate for each item, and then completes if the condition is satisfied.
timeout
(long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)
SignalV
long
time
, TimeUnit
unit
, ScheduledExecutorService
scheduler
)V
long time |
Time to take values. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A unit of time for the specified timeout. |
ScheduledExecutorService scheduler |
An event scheduler. |
Signal |
A new
|
Returns a Signal that mirrors the source Signal but applies a timeout policy for each
emitted item. If the next item isn't emitted preassignin the specified timeout duration
starting from its predecessor, the resulting Signal terminates and notifies observers of a
TimeoutException
.
throttle
(long
time
, TimeUnit
unit
)
SignalV
long
time
, TimeUnit
unit
)V
long time |
Time to wait before sending another item after emitting the last item. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A unit of time for the specified timeout. |
Signal |
A new
|
Throttles by skipping values until "skipDuration" passes and then emits the next received value.
Ignores the values from an Signal
sequence which are followed by another value before
due time preassign the specified source and time.
throttle
(VariableLong
time
, TimeUnit
unit
)
SignalV
VariableLong
time
, TimeUnit
unit
)V
Variable time |
Time to wait before sending another item after emitting the last item. Zero or negative number will ignore this instruction. |
TimeUnit unit |
A unit of time for the specified timeout. |
Signal |
A new
|
Throttles by skipping values until "skipDuration" passes and then emits the next received value.
Ignores the values from an Signal
sequence which are followed by another value before
due time preassign the specified source and time.
toggle
(E
values
)
SignalE
E
values
)E
E |
|
E values |
A list of constants to apply to each value emitted by this |
Signal |
A new
|
Returns an Signal
that applies the given two constants alternately to each item
emitted by an Signal
and emits the result.
waitForTerminate
()
SignalV
V
Signal |
Synchronization Support Tool : Wait in the current thread until this Signal
to be
terminated. Termination is one of the states of completed, error or disposed.
$
(WiseFunctionV
, SignalR
function
)
SignalR
WiseFunctionV
, SignalR
function
)R
R |
|
WiseFunction function |
A function that, when applied to an item emitted by the source |
Signal |
An |
This is another name for #flatMap(WiseFunction)
, primarily for use in DSL.