public static class TestEnvironment.TestSubscriber<T> extends java.lang.Object implements Subscriber<T>
Modifier and Type | Field and Description |
---|---|
protected TestEnvironment |
env |
Constructor and Description |
---|
TestSubscriber(TestEnvironment env) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
onComplete()
Successful terminal state.
|
void |
onError(java.lang.Throwable cause)
Failed terminal state.
|
void |
onNext(T element)
Data notification sent by the
Publisher in response to requests to Subscription.request(long) . |
void |
onSubscribe(Subscription subscription)
Invoked after calling
Publisher.subscribe(Subscriber) . |
protected final TestEnvironment env
public TestSubscriber(TestEnvironment env)
public void onError(java.lang.Throwable cause)
Subscriber
No further events will be sent even if Subscription.request(long)
is invoked again.
onError
in interface Subscriber<T>
cause
- the throwable signaledpublic void onComplete()
Subscriber
No further events will be sent even if Subscription.request(long)
is invoked again.
onComplete
in interface Subscriber<T>
public void onNext(T element)
Subscriber
Publisher
in response to requests to Subscription.request(long)
.onNext
in interface Subscriber<T>
element
- the element signaledpublic void onSubscribe(Subscription subscription)
Subscriber
Publisher.subscribe(Subscriber)
.
No data will start flowing until Subscription.request(long)
is invoked.
It is the responsibility of this Subscriber
instance to call Subscription.request(long)
whenever more data is wanted.
The Publisher
will send notifications only in response to Subscription.request(long)
.
onSubscribe
in interface Subscriber<T>
subscription
- Subscription
that allows requesting data via Subscription.request(long)
public void cancel()