public final class TestCompletable extends Completable implements CompletableSource
Completable
& CompletableSource
whose outgoing signals to its Subscriber
s can be
controlled.
Behavior beyond simply delegating signals to the Subscriber
is accomplished by a
Function<Subscriber<? super T>, Subscriber<? super T>>
. This Function
is
invoked for every CompletableSource.subscribe(Subscriber)
invocation, and the result is used as the delegate for subsequent
onSubscribe(Cancellable)
, onComplete()
, and
onError(Throwable)
calls. See TestCompletable.Builder
for more information.
onSubscribe(Cancellable)
automatically when subscribed to.Modifier and Type | Class and Description |
---|---|
static class |
TestCompletable.Builder
Allows for creating
TestCompletable s with non-default settings. |
CompletableSource.Processor, CompletableSource.Subscriber
Constructor and Description |
---|
TestCompletable()
Create a
TestCompletable with the defaults. |
Modifier and Type | Method and Description |
---|---|
protected void |
handleSubscribe(CompletableSource.Subscriber subscriber)
Handles a subscriber to this
Completable . |
boolean |
isSubscribed()
|
void |
onComplete()
Completes the
Subscriber . |
void |
onError(java.lang.Throwable t)
Delivers the
Throwable t to the Subscriber . |
void |
onSubscribe(Cancellable cancellable)
|
void |
subscribe(CompletableSource.Subscriber subscriber)
Subscribes to the outcome of this
CompletableSource . |
afterCancel, afterFinally, afterFinally, afterOnComplete, afterOnError, afterOnSubscribe, afterSubscriber, amb, amb, ambWith, anyOf, anyOf, beforeCancel, beforeFinally, beforeFinally, beforeOnComplete, beforeOnError, beforeOnSubscribe, beforeSubscriber, completed, concat, concat, concat, defer, failed, fromFuture, fromRunnable, fromStage, idleTimeout, idleTimeout, idleTimeout, idleTimeout, liftAsync, liftSync, merge, merge, merge, mergeAll, mergeAll, mergeAll, mergeAll, mergeAllDelayError, mergeAllDelayError, mergeAllDelayError, mergeAllDelayError, mergeDelayError, mergeDelayError, never, onErrorResume, publishAndSubscribeOn, publishAndSubscribeOnOverride, publishOn, publishOnOverride, repeat, repeatWhen, retry, retryWhen, subscribe, subscribe, subscribeInternal, subscribeOn, subscribeOnOverride, subscribeShareContext, toCompletionStage, toFuture, toPublisher, toSingle, whenCancel, whenFinally, whenFinally, whenOnComplete, whenOnError, whenOnSubscribe, whenSubscriber
public TestCompletable()
TestCompletable
with the defaults. See Defaults section of class javadoc.public boolean isSubscribed()
true
if this TestCompletable
has been subscribed to, false
otherwise.protected void handleSubscribe(CompletableSource.Subscriber subscriber)
Completable
Completable
.
This method is invoked internally by Completable
for every call to the
Completable.subscribeInternal(CompletableSource.Subscriber)
method.
handleSubscribe
in class Completable
subscriber
- the subscriber.public void subscribe(CompletableSource.Subscriber subscriber)
CompletableSource
CompletableSource
.subscribe
in interface CompletableSource
subscriber
- of the outcome.PublisherSource.subscribe(PublisherSource.Subscriber)
public void onSubscribe(Cancellable cancellable)
Cancellable
to the Subscriber
's Subscriber#onSubscribe(Cancellable)
.
In the case of auto-on-subscribe
, the delegating Cancellable
sent to
the Subscriber
by the auto-on-subscribe will switch to cancellable
.
cancellable
- the Cancellable
public void onComplete()
Subscriber
.Subscriber#onComplete()
public void onError(java.lang.Throwable t)
Throwable
t
to the Subscriber
.t
- the error to deliver.Subscriber#onError(Throwable)