public final class FlowableTransformers
extends java.lang.Object
FlowableTransformer,
use Flowable.compose(FlowableTransformer)
to apply the operators to an existing sequence.| Modifier and Type | Method and Description |
|---|---|
static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> |
bufferUntil(io.reactivex.functions.Predicate<? super T> predicate)
Buffers elements into a List until the given predicate returns true at which
point a new empty buffer is started.
|
static <T,C extends java.util.Collection<? super T>> |
bufferUntil(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
Buffers elements into a custom collection until the given predicate returns true at which
point a new empty custom collection is started.
|
static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> |
bufferWhile(io.reactivex.functions.Predicate<? super T> predicate)
Buffers elements into a List while the given predicate returns true; if the
predicate returns false for an item, a new buffer is created with the specified item.
|
static <T,C extends java.util.Collection<? super T>> |
bufferWhile(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
Buffers elements into a custom collection while the given predicate returns true; if the
predicate returns false for an item, a new collection is created with the specified item.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
every(long keep)
Relays every Nth item from upstream.
|
static <T,R> io.reactivex.FlowableTransformer<T,R> |
mapFilter(io.reactivex.functions.BiConsumer<? super T,? super BasicEmitter<R>> consumer)
Allows mapping or filtering an upstream value through an emitter.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
onBackpressureTimeout(int maxSize,
long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
io.reactivex.functions.Consumer<? super T> onEvict)
Buffers the incoming values from upstream up to a maximum size or timeout if
the downstream can't keep up.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Buffers the incoming values from upstream up to a maximum timeout if
the downstream can't keep up.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
Buffers the incoming values from upstream up to a maximum timeout if
the downstream can't keep up, running on a custom scheduler.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
io.reactivex.functions.Consumer<? super T> onEvict)
Buffers the incoming values from upstream up to a maximum size or timeout if
the downstream can't keep up.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
boolean delayError)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
boolean delayError)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit)
Inserts a time delay between emissions from the upstream source.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
boolean delayError)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
Inserts a time delay between emissions from the upstream source.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
boolean delayError)
Inserts a time delay between emissions from the upstream source, including an initial delay.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specivied valve state.
|
static <T> io.reactivex.FlowableTransformer<T,T> |
valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen,
int bufferSize)
Relays values until the other Publisher signals false and resumes if the other
Publisher signals true again, like closing and opening a valve and not losing
any items from the main source and starts with the specivied valve state and the specified
buffer size hint.
|
@SchedulerSupport(value="none") @BackpressureSupport(value=PASS_THROUGH) public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<java.lang.Boolean> other)
Properties:
IllegalStateException.Scheduler.Flowable.bufferSize() to hold onto values if the valve is closed.T - the value type of the main sourceother - the other sourcejava.lang.NullPointerException - if other is null@SchedulerSupport(value="none")
@BackpressureSupport(value=PASS_THROUGH)
public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen)
Properties:
IllegalStateException.Scheduler.Flowable.bufferSize() to hold onto values if the valve is closed.T - the value type of the main sourceother - the other sourcedefaultOpen - should the valve start as open?java.lang.NullPointerException - if other is null@SchedulerSupport(value="none")
@BackpressureSupport(value=PASS_THROUGH)
public static <T> io.reactivex.FlowableTransformer<T,T> valve(org.reactivestreams.Publisher<java.lang.Boolean> other,
boolean defaultOpen,
int bufferSize)
Properties:
IllegalStateException.Scheduler.T - the value type of the main sourceother - the other sourcedefaultOpen - should the valve start as open?bufferSize - the buffer size hint (the chunk size of the underlying unbounded buffer)java.lang.IllegalArgumentException - if bufferSize <= 0java.lang.NullPointerException - if other is null@SchedulerSupport(value="none") @BackpressureSupport(value=FULL) public static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> bufferWhile(io.reactivex.functions.Predicate<? super T> predicate)
T - the source value typepredicate - the predicate receiving the current value and if returns false,
a new buffer is created with the specified item@SchedulerSupport(value="none")
@BackpressureSupport(value=FULL)
public static <T,C extends java.util.Collection<? super T>> io.reactivex.FlowableTransformer<T,C> bufferWhile(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
T - the source value typeC - the collection typepredicate - the predicate receiving the current value and if returns false,
a new collection is created with the specified itembufferSupplier - the callable that returns a fresh collection@SchedulerSupport(value="none") @BackpressureSupport(value=FULL) public static <T> io.reactivex.FlowableTransformer<T,java.util.List<T>> bufferUntil(io.reactivex.functions.Predicate<? super T> predicate)
T - the source value typepredicate - the predicate receiving the current itam and if returns true,
the current buffer is emitted and a fresh empty buffer is created@SchedulerSupport(value="none")
@BackpressureSupport(value=FULL)
public static <T,C extends java.util.Collection<? super T>> io.reactivex.FlowableTransformer<T,C> bufferUntil(io.reactivex.functions.Predicate<? super T> predicate,
java.util.concurrent.Callable<C> bufferSupplier)
T - the source value typeC - the collection typepredicate - the predicate receiving the current itam and if returns true,
the current collection is emitted and a fresh empty collection is createdbufferSupplier - the callable that returns a fresh collection@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="io.reactivex:computation")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit)
Scheduler.T - the value typebetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay values@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
Scheduler you provide.T - the value typebetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesscheduler - the scheduler to delay and emit the values on@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="io.reactivex:computation")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit)
Scheduler.T - the value typeinitialDelay - the initial delaybetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay values@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
Scheduler you provide.T - the value typeinitialDelay - the initial delaybetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesscheduler - the scheduler to delay and emit the values on@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="io.reactivex:computation")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
boolean delayError)
Scheduler.T - the value typebetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesdelayError - delay the onError event from upstream@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
boolean delayError)
Scheduler you provide.T - the value typebetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesscheduler - the scheduler to delay and emit the values ondelayError - delay the onError event from upstream@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="io.reactivex:computation")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
boolean delayError)
Scheduler.T - the value typeinitialDelay - the initial delaybetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesdelayError - delay the onError event from upstream@BackpressureSupport(value=PASS_THROUGH)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> spanout(long initialDelay,
long betweenDelay,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
boolean delayError)
Scheduler you provide.T - the value typeinitialDelay - the initial delaybetweenDelay - the (minimum) delay time between elementsunit - the time unit of the initial delay and the between delay valuesscheduler - the scheduler to delay and emit the values ondelayError - delay the onError event from upstream@BackpressureSupport(value=PASS_THROUGH) @SchedulerSupport(value="none") public static <T,R> io.reactivex.FlowableTransformer<T,R> mapFilter(io.reactivex.functions.BiConsumer<? super T,? super BasicEmitter<R>> consumer)
T - the input value typeR - the output value typeconsumer - the consumer that is called for each upstream value and should call one of the doXXX methods
on the BasicEmitter it receives (individual to each Subscriber).@BackpressureSupport(value=UNBOUNDED_IN)
@SchedulerSupport(value="io.reactivex:computation")
public static <T> io.reactivex.FlowableTransformer<T,T> onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
T - the value typetimeout - the maximum age of an element in the bufferunit - the time unit of the timeoutfor more options@BackpressureSupport(value=UNBOUNDED_IN)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
io.reactivex.functions.Consumer<? super T> onEvict)
T - the value typetimeout - the maximum age of an element in the bufferunit - the time unit of the timeoutscheduler - the scheduler to be used as time source and to trigger the timeout & evictiononEvict - called when an element is evicted, maybe concurrently@BackpressureSupport(value=UNBOUNDED_IN)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> onBackpressureTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler)
T - the value typetimeout - the maximum age of an element in the bufferunit - the time unit of the timeoutscheduler - the scheduler to be used as time source and to trigger the timeout & evictionfor more options@BackpressureSupport(value=UNBOUNDED_IN)
@SchedulerSupport(value="custom")
public static <T> io.reactivex.FlowableTransformer<T,T> onBackpressureTimeout(int maxSize,
long timeout,
java.util.concurrent.TimeUnit unit,
io.reactivex.Scheduler scheduler,
io.reactivex.functions.Consumer<? super T> onEvict)
T - the value typemaxSize - the maximum number of elements in the buffer, beyond that,
the oldest element is evictedtimeout - the maximum age of an element in the bufferunit - the time unit of the timeoutscheduler - the scheduler to be used as time source and to trigger the timeout & evictiononEvict - called when an element is evicted, maybe concurrently@BackpressureSupport(value=SPECIAL) @SchedulerSupport(value="none") public static <T> io.reactivex.FlowableTransformer<T,T> every(long keep)
times what the downstream requests and skips @code keep-1} items.Scheduler.T - the value typekeep - the period of items to keep, i.e., this minus one items will be dropped
before emitting an item directly