static @NonNull Completable
amb(@NonNull Iterable<? extends CompletableSource> sources)
Returns a
Completable
which terminates as soon as one of the source
Completable
s in the
Iterable
sequence terminates (normally or with an error) and disposes all other
Completable
s.
static @NonNull Completable
ambArray(CompletableSource... sources)
Returns a Completable
which terminates as soon as one of the source Completable
s terminates (normally or with an error) and disposes all other Completable
s.
@NonNull Completable
ambWith(@NonNull CompletableSource other)
Returns a
Completable
that emits the a terminated event of either this
Completable
or the other
CompletableSource
, whichever fires first.
@NonNull Completable
andThen(@NonNull CompletableSource next)
Returns a
Completable
that first runs this
Completable
and then the other
CompletableSource
.
<T> @NonNull Maybe<T>
andThen(@NonNull MaybeSource<T> next)
Returns a
Maybe
which will subscribe to this
Completable
and once that is completed then will subscribe to the
next
MaybeSource
.
<T> @NonNull Observable<T>
andThen(@NonNull ObservableSource<T> next)
Returns an
Observable
which will subscribe to this
Completable
and once that is completed then will subscribe to the
next
ObservableSource
.
<T> @NonNull Flowable<T>
andThen(@NonNull Publisher<T> next)
Returns a
Flowable
which will subscribe to this
Completable
and once that is completed then will subscribe to the
next
Publisher
.
<T> @NonNull Single<T>
andThen(@NonNull SingleSource<T> next)
Returns a
Single
which will subscribe to this
Completable
and once that is completed then will subscribe to the
next
SingleSource
.
void
blockingAwait()
Subscribes to and awaits the termination of this Completable
instance in a blocking manner and rethrows any exception emitted.
boolean
blockingAwait(long timeout, @NonNull TimeUnit unit)
Subscribes to and awaits the termination of this Completable
instance in a blocking manner with a specific timeout and rethrows any exception emitted within the timeout window.
void
blockingSubscribe()
Subscribes to the current Completable
and blocks the current thread until it terminates.
void
blockingSubscribe(@NonNull Action onComplete)
Subscribes to the current Completable
and calls given onComplete
callback on the current thread when it completes normally.
void
blockingSubscribe(@NonNull Action onComplete, @NonNull Consumer<? super Throwable> onError)
Subscribes to the current Completable
and calls the appropriate callback on the current thread when it terminates.
void
blockingSubscribe(@NonNull CompletableObserver observer)
Subscribes to the current
Completable
and calls the appropriate
CompletableObserver
method on the
current thread.
@NonNull Completable
cache()
Subscribes to this
Completable
only once, when the first
CompletableObserver
subscribes to the result
Completable
, caches its terminal event and relays/replays it to observers.
static @NonNull Completable
complete()
Returns a Completable
instance that completes immediately when subscribed to.
@NonNull Completable
compose(@NonNull CompletableTransformer transformer)
static @NonNull Completable
concat(@NonNull Iterable<? extends CompletableSource> sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concat(@NonNull Publisher<? extends CompletableSource> sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concat(@NonNull Publisher<? extends CompletableSource> sources, int prefetch)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concatArray(CompletableSource... sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concatArrayDelayError(CompletableSource... sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concatDelayError(@NonNull Iterable<? extends CompletableSource> sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concatDelayError(@NonNull Publisher<? extends CompletableSource> sources)
Returns a Completable
which completes only when all sources complete, one after another.
static @NonNull Completable
concatDelayError(@NonNull Publisher<? extends CompletableSource> sources, int prefetch)
Returns a Completable
which completes only when all sources complete, one after another.
@NonNull Completable
concatWith(@NonNull CompletableSource other)
static @NonNull Completable
create(@NonNull CompletableOnSubscribe source)
Provides an API (via a cold Completable
) that bridges the reactive world with the callback-style world.
static @NonNull Completable
defer(@NonNull Supplier<? extends CompletableSource> supplier)
Defers the subscription to a Completable
instance returned by a supplier.
@NonNull Completable
delay(long time, @NonNull TimeUnit unit)
Returns a Completable
which delays the emission of the completion event by the given time.
@NonNull Completable
delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
Completable
which delays the emission of the completion event by the given time while running on the specified
Scheduler
.
@NonNull Completable
delay(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean delayError)
Returns a
Completable
which delays the emission of the completion event, and optionally the error as well, by the given time while running on the specified
Scheduler
.
@NonNull Completable
delaySubscription(long time, @NonNull TimeUnit unit)
Returns a Completable
that delays the subscription to the upstream by a given amount of time.
@NonNull Completable
delaySubscription(long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
Completable
that delays the subscription to the upstream by a given amount of time, both waiting and subscribing on a given
Scheduler
.
@NonNull Completable
doAfterTerminate(@NonNull Action onAfterTerminate)
Returns a
Completable
instance that calls the given
onAfterTerminate
Action
after this
Completable
completes normally or with an exception.
@NonNull Completable
doFinally(@NonNull Action onFinally)
Calls the specified
Action
after this
Completable
signals
onError
or
onComplete
or gets disposed by the downstream.
@NonNull Completable
doOnComplete(@NonNull Action onComplete)
Returns a
Completable
which calls the given
onComplete
Action
if this
Completable
completes.
@NonNull Completable
doOnDispose(@NonNull Action onDispose)
@NonNull Completable
doOnError(@NonNull Consumer<? super Throwable> onError)
Returns a
Completable
which calls the given
onError
Consumer
if this
Completable
emits an error.
@NonNull Completable
doOnEvent(@NonNull Consumer<? super Throwable> onEvent)
Returns a
Completable
which calls the given
onEvent
Consumer
with the
Throwable
for an
onError
or
null
for an
onComplete
signal from this
Completable
before delivering the signal to the downstream.
@NonNull Completable
doOnLifecycle(@NonNull Consumer<? super Disposable> onSubscribe, @NonNull Action onDispose)
Calls the appropriate
onXXX
method (shared between all
CompletableObserver
s) for the lifecycle events of the sequence (subscription, disposal).
@NonNull Completable
doOnSubscribe(@NonNull Consumer<? super Disposable> onSubscribe)
Returns a
Completable
instance that calls the given
onSubscribe
callback with the disposable that the downstream
CompletableObserver
s receive upon subscription.
@NonNull Completable
doOnTerminate(@NonNull Action onTerminate)
Returns a
Completable
instance that calls the given
onTerminate
Action
just before this
Completable
completes normally or with an exception.
static @NonNull Completable
error(@NonNull Supplier<? extends Throwable> supplier)
Creates a
Completable
which calls the given error supplier for each subscriber and emits its returned
Throwable
.
static @NonNull Completable
error(@NonNull Throwable throwable)
Creates a
Completable
instance that emits the given
Throwable
exception to subscribers.
static @NonNull Completable
fromAction(@NonNull Action action)
Returns a
Completable
instance that runs the given
Action
for each
CompletableObserver
and emits either an exception or simply completes.
static @NonNull Completable
fromCallable(@NonNull Callable<?> callable)
Returns a
Completable
which when subscribed, executes the
Callable
function, ignores its normal result and emits
onError
or
onComplete
only.
static @NonNull Completable
fromCompletionStage(@NonNull CompletionStage<?> stage)
static @NonNull Completable
fromFuture(@NonNull Future<?> future)
Returns a
Completable
instance that reacts to the termination of the given
Future
in a blocking fashion.
static <T> @NonNull Completable
fromMaybe(@NonNull MaybeSource<T> maybe)
Returns a
Completable
instance that when subscribed to, subscribes to the
MaybeSource
instance and emits an
onComplete
event if the maybe emits
onSuccess
/
onComplete
or forwards any
onError
events.
static <T> @NonNull Completable
fromObservable(@NonNull ObservableSource<T> observable)
Returns a
Completable
instance that subscribes to the given
ObservableSource
, ignores all values and emits only the terminal event.
static <T> @NonNull Completable
fromPublisher(@NonNull Publisher<T> publisher)
Returns a
Completable
instance that subscribes to the given
Publisher
, ignores all values and emits only the terminal event.
static @NonNull Completable
fromRunnable(@NonNull Runnable run)
Returns a
Completable
instance that runs the given
Runnable
for each
CompletableObserver
and emits either its unchecked exception or simply completes.
static <T> @NonNull Completable
fromSingle(@NonNull SingleSource<T> single)
Returns a
Completable
instance that when subscribed to, subscribes to the
SingleSource
instance and emits a completion event if the single emits
onSuccess
or forwards any
onError
events.
static @NonNull Completable
fromSupplier(@NonNull Supplier<?> supplier)
Returns a
Completable
which when subscribed, executes the
Supplier
function, ignores its normal result and emits
onError
or
onComplete
only.
@NonNull Completable
hide()
Hides the identity of this
Completable
and its
Disposable
.
@NonNull Completable
lift(@NonNull CompletableOperator onLift)
This method requires advanced knowledge about building operators, please consider other standard composition methods first;
Returns a
Completable
which, when subscribed to, invokes the
apply(CompletableObserver)
method of the provided
CompletableOperator
for each individual downstream
Completable
and allows the insertion of a custom operator by accessing the downstream's
CompletableObserver
during this subscription phase and providing a new
CompletableObserver
, containing the custom operator's intended business logic, that will be used in the subscription process going further upstream.
<T> @NonNull Single<Notification<T>>
materialize()
Maps the signal types of this
Completable
into a
Notification
of the same kind and emits it as a single success value to downstream.
static @NonNull Completable
merge(@NonNull Iterable<? extends CompletableSource> sources)
Returns a
Completable
instance that subscribes to all sources at once and completes only when all source
CompletableSource
s complete or one of them emits an error.
static @NonNull Completable
merge(@NonNull Publisher<? extends CompletableSource> sources)
Returns a
Completable
instance that subscribes to all sources at once and completes only when all source
CompletableSource
s complete or one of them emits an error.
static @NonNull Completable
merge(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency)
Returns a
Completable
instance that keeps subscriptions to a limited number of sources at once and completes only when all source
CompletableSource
s complete or one of them emits an error.
static @NonNull Completable
mergeArray(CompletableSource... sources)
Returns a
Completable
instance that subscribes to all sources at once and completes only when all source
CompletableSource
s complete or one of them emits an error.
static @NonNull Completable
mergeArrayDelayError(CompletableSource... sources)
Returns a
Completable
that subscribes to all
CompletableSource
s in the source array and delays any error emitted by any of the inner
CompletableSource
s until all of them terminate in a way or another.
static @NonNull Completable
mergeDelayError(@NonNull Iterable<? extends CompletableSource> sources)
Returns a
Completable
that subscribes to all
CompletableSource
s in the source sequence and delays any error emitted by any of the inner
CompletableSource
s until all of them terminate in a way or another.
static @NonNull Completable
mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources)
Returns a
Completable
that subscribes to all
CompletableSource
s in the source sequence and delays any error emitted by either the sources
Publisher
or any of the inner
CompletableSource
s until all of them terminate in a way or another.
static @NonNull Completable
mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency)
Returns a
Completable
that subscribes to a limited number of inner
CompletableSource
s at once in the source sequence and delays any error emitted by either the sources
Publisher
or any of the inner
CompletableSource
s until all of them terminate in a way or another.
@NonNull Completable
mergeWith(@NonNull CompletableSource other)
Returns a
Completable
which subscribes to this and the other
CompletableSource
and completes when both of them complete or one emits an error.
static @NonNull Completable
never()
Returns a Completable
that never calls onError
or onComplete
.
@NonNull Completable
observeOn(@NonNull Scheduler scheduler)
Returns a
Completable
which emits the terminal events from the thread of the specified
Scheduler
.
@NonNull Completable
onErrorComplete()
Returns a
Completable
instance that if this
Completable
emits an error, it will emit an
onComplete
and swallow the upstream
Throwable
.
@NonNull Completable
onErrorComplete(@NonNull Predicate<? super Throwable> predicate)
Returns a
Completable
instance that if this
Completable
emits an error and the
Predicate
returns
true
, it will emit an
onComplete
and swallow the
Throwable
.
@NonNull Completable
onErrorResumeNext(@NonNull Function<? super Throwable,? extends CompletableSource> fallbackSupplier)
Returns a
Completable
instance that when encounters an error from this
Completable
, calls the specified
mapper
Function
that returns a
CompletableSource
instance for it and resumes the execution with it.
@NonNull Completable
onErrorResumeWith(@NonNull CompletableSource fallback)
Resumes the flow with the given
CompletableSource
when the current
Completable
fails instead of signaling the error via
onError
.
<T> @NonNull Maybe<T>
onErrorReturn(@NonNull Function<? super Throwable,? extends T> itemSupplier)
Ends the flow with a success item returned by a function for the
Throwable
error signaled by the current
Completable
instead of signaling the error via
onError
.
<T> @NonNull Maybe<T>
onErrorReturnItem(T item)
Ends the flow with the given success item when the current Completable
fails instead of signaling the error via onError
.
@NonNull Completable
onTerminateDetach()
Nulls out references to the upstream producer and downstream
CompletableObserver
if the sequence is terminated or downstream calls
dispose()
.
@NonNull Completable
repeat()
Returns a Completable
that repeatedly subscribes to this Completable
until disposed.
@NonNull Completable
repeat(long times)
Returns a Completable
that subscribes repeatedly at most the given number of times to this Completable
.
@NonNull Completable
repeatUntil(@NonNull BooleanSupplier stop)
Returns a
Completable
that repeatedly subscribes to this
Completable
so long as the given stop
BooleanSupplier
returns
false
.
@NonNull Completable
repeatWhen(@NonNull Function<? super Flowable<Object>,? extends Publisher<?>> handler)
Returns a
Completable
instance that repeats when the
Publisher
returned by the handler
Function
emits an item or completes when this
Publisher
emits an
onComplete
event.
@NonNull Completable
retry()
Returns a Completable
that retries this Completable
as long as it emits an onError
event.
@NonNull Completable
retry(@NonNull BiPredicate<? super Integer,? super Throwable> predicate)
Returns a Completable
that retries this Completable
in case of an error as long as the predicate
returns true
.
@NonNull Completable
retry(long times)
Returns a Completable
that when this Completable
emits an error, retries at most the given number of times before giving up and emitting the last error.
@NonNull Completable
retry(long times, @NonNull Predicate<? super Throwable> predicate)
Returns a Completable
that when this Completable
emits an error, retries at most times or until the predicate returns false
, whichever happens first and emitting the last error.
@NonNull Completable
retry(@NonNull Predicate<? super Throwable> predicate)
Returns a
Completable
that when this
Completable
emits an error, calls the given predicate with the latest
Throwable
to decide whether to resubscribe to the upstream or not.
@NonNull Completable
retryUntil(@NonNull BooleanSupplier stop)
Retries until the given stop function returns true
.
@NonNull Completable
retryWhen(@NonNull Function<? super Flowable<Throwable>,? extends Publisher<?>> handler)
Returns a
Completable
which given a
Publisher
and when this
Completable
emits an error, delivers that error through a
Flowable
and the
Publisher
should signal a value indicating a retry in response or a terminal event indicating a termination.
void
safeSubscribe(@NonNull CompletableObserver observer)
static @NonNull Single<Boolean>
sequenceEqual(@NonNull CompletableSource source1, @NonNull CompletableSource source2)
@NonNull Completable
startWith(@NonNull CompletableSource other)
Returns a
Completable
which first runs the other
CompletableSource
then the current
Completable
if the other completed normally.
<T> @NonNull Flowable<T>
startWith(@NonNull MaybeSource<T> other)
Returns a
Flowable
which first runs the other
MaybeSource
then the current
Completable
if the other succeeded or completed normally.
<T> @NonNull Observable<T>
startWith(@NonNull ObservableSource<T> other)
<T> @NonNull Flowable<T>
startWith(@NonNull Publisher<T> other)
Returns a
Flowable
which first delivers the events of the other
Publisher
then runs the current
Completable
.
<T> @NonNull Flowable<T>
startWith(@NonNull SingleSource<T> other)
Returns a
Flowable
which first runs the other
SingleSource
then the current
Completable
if the other succeeded normally.
@NonNull Disposable
subscribe()
Subscribes to this
Completable
and returns a
Disposable
which can be used to dispose the subscription.
@NonNull Disposable
subscribe(@NonNull Action onComplete)
Subscribes to this
Completable
and calls the given
Action
when this
Completable
completes normally.
@NonNull Disposable
subscribe(@NonNull Action onComplete, @NonNull Consumer<? super Throwable> onError)
Subscribes to this Completable
and calls back either the onError
or onComplete
functions.
@NonNull Disposable
subscribe(@NonNull Action onComplete, @NonNull Consumer<? super Throwable> onError, @NonNull DisposableContainer container)
Wraps the given onXXX callbacks into a
Disposable
CompletableObserver
, adds it to the given
DisposableContainer
and ensures, that if the upstream terminates or this particular
Disposable
is disposed, the
CompletableObserver
is removed from the given composite.
void
subscribe(@NonNull CompletableObserver observer)
protected abstract void
subscribeActual(@NonNull CompletableObserver observer)
Implement this method to handle the incoming
CompletableObserver
s and perform the business logic in your operator.
@NonNull Completable
subscribeOn(@NonNull Scheduler scheduler)
Returns a
Completable
which subscribes the downstream subscriber on the specified scheduler, making sure the subscription side-effects happen on that specific thread of the
Scheduler
.
<E extends CompletableObserver>
E
subscribeWith(E observer)
Subscribes a given
CompletableObserver
(subclass) to this
Completable
and returns the given
CompletableObserver
as is.
static @NonNull Completable
switchOnNext(@NonNull Publisher<? extends CompletableSource> sources)
Switches between
CompletableSource
s emitted by the source
Publisher
whenever a new
CompletableSource
is emitted, disposing the previously running
CompletableSource
, exposing the setup as a
Completable
sequence.
static @NonNull Completable
switchOnNextDelayError(@NonNull Publisher<? extends CompletableSource> sources)
Switches between
CompletableSource
s emitted by the source
Publisher
whenever a new
CompletableSource
is emitted, disposing the previously running
CompletableSource
, exposing the setup as a
Completable
sequence and delaying all errors from all of them until all terminate.
@NonNull Completable
takeUntil(@NonNull CompletableSource other)
Terminates the downstream if this or the other Completable
terminates (wins the termination race) while disposing the connection to the losing source.
@NonNull TestObserver<Void>
test()
Creates a
TestObserver
and subscribes it to this
Completable
.
@NonNull TestObserver<Void>
test(boolean dispose)
Creates a
TestObserver
optionally in cancelled state, then subscribes it to this
Completable
.
@NonNull Completable
timeout(long timeout, @NonNull TimeUnit unit)
Returns a
Completabl
e that runs this
Completable
and emits a
TimeoutException
in case this
Completable
doesn't complete within the given time.
@NonNull Completable
timeout(long timeout, @NonNull TimeUnit unit, @NonNull CompletableSource fallback)
Returns a
Completable
that runs this
Completable
and switches to the other
CompletableSource
in case this
Completable
doesn't complete within the given time.
@NonNull Completable
timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
Completable
that runs this
Completable
and emits a
TimeoutException
in case this
Completable
doesn't complete within the given time while "waiting" on the specified
Scheduler
.
@NonNull Completable
timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull CompletableSource fallback)
Returns a
Completable
that runs this
Completable
and switches to the other
CompletableSource
in case this
Completable
doesn't complete within the given time while "waiting" on the specified
Scheduler
.
static @NonNull Completable
timer(long delay, @NonNull TimeUnit unit)
Returns a Completable
instance that fires its onComplete
event after the given delay elapsed.
static @NonNull Completable
timer(long delay, @NonNull TimeUnit unit, @NonNull Scheduler scheduler)
Returns a
Completable
instance that fires its
onComplete
event after the given delay elapsed by using the supplied
Scheduler
.
<R> R
to(@NonNull CompletableConverter<? extends R> converter)
Calls the specified
CompletableConverter
function during assembly time and returns its resulting value.
<T> @NonNull CompletionStage<T>
toCompletionStage(T defaultItem)
Signals the given default item when the upstream completes or signals the upstream error via a
CompletionStage
.
<T> @NonNull Flowable<T>
toFlowable()
Returns a
Flowable
which when subscribed to subscribes to this
Completable
and relays the terminal events to the downstream
Subscriber
.
@NonNull Future<Void>
toFuture()
Returns a
Future
representing the termination of the current
Completable
via a
null
value.
<T> @NonNull Maybe<T>
toMaybe()
Converts this
Completable
into a
Maybe
.
<T> @NonNull Observable<T>
toObservable()
Returns an
Observable
which when subscribed to subscribes to this
Completable
and relays the terminal events to the downstream
Observer
.
<T> @NonNull Single<T>
toSingle(@NonNull Supplier<? extends T> completionValueSupplier)
Converts this
Completable
into a
Single
which when this
Completable
completes normally, calls the given
Supplier
and emits its returned value through
onSuccess
.
<T> @NonNull Single<T>
toSingleDefault(T completionValue)
Converts this
Completable
into a
Single
which when this
Completable
completes normally, emits the given value through
onSuccess
.
static @NonNull Completable
unsafeCreate(@NonNull CompletableSource onSubscribe)
Constructs a Completable
instance by wrapping the given source callback without any safeguards; you should manage the lifecycle and response to downstream disposal.
@NonNull Completable
unsubscribeOn(@NonNull Scheduler scheduler)
Returns a
Completable
which makes sure when an observer disposes the subscription, the
dispose()
method is called on the specified
Scheduler
.
static <R> @NonNull Completable
using(@NonNull Supplier<R> resourceSupplier, @NonNull Function<? super R,? extends CompletableSource> sourceSupplier, @NonNull Consumer<? super R> resourceCleanup)
Returns a
Completable
instance which manages a resource along with a custom
CompletableSource
instance while the subscription is active.
static <R> @NonNull Completable
using(@NonNull Supplier<R> resourceSupplier, @NonNull Function<? super R,? extends CompletableSource> sourceSupplier, @NonNull Consumer<? super R> resourceCleanup, boolean eager)
Returns a
Completable
instance which manages a resource along with a custom
CompletableSource
instance while the subscription is active and performs eager or lazy resource disposition.
static @NonNull Completable
wrap(@NonNull CompletableSource source)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4