Package org.reactivestreams.tck
Class TestEnvironment.TestSubscriber<T>
- java.lang.Object
-
- org.reactivestreams.tck.TestEnvironment.TestSubscriber<T>
-
- All Implemented Interfaces:
Subscriber<T>
- Direct Known Subclasses:
TestEnvironment.ManualSubscriber
- Enclosing class:
- TestEnvironment
public static class TestEnvironment.TestSubscriber<T> extends java.lang.Object implements Subscriber<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected TestEnvironment
env
(package private) TestEnvironment.Promise<Subscription>
subscription
-
Constructor Summary
Constructors Constructor Description TestSubscriber(TestEnvironment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 thePublisher
in response to requests toSubscription.request(long)
.void
onSubscribe(Subscription subscription)
Invoked after callingPublisher.subscribe(Subscriber)
.
-
-
-
Field Detail
-
subscription
final TestEnvironment.Promise<Subscription> subscription
-
env
protected final TestEnvironment env
-
-
Constructor Detail
-
TestSubscriber
public TestSubscriber(TestEnvironment env)
-
-
Method Detail
-
onError
public void onError(java.lang.Throwable cause)
Description copied from interface:Subscriber
Failed terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again.- Specified by:
onError
in interfaceSubscriber<T>
- Parameters:
cause
- the throwable signaled
-
onComplete
public void onComplete()
Description copied from interface:Subscriber
Successful terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again.- Specified by:
onComplete
in interfaceSubscriber<T>
-
onNext
public void onNext(T element)
Description copied from interface:Subscriber
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.- Specified by:
onNext
in interfaceSubscriber<T>
- Parameters:
element
- the element signaled
-
onSubscribe
public void onSubscribe(Subscription subscription)
Description copied from interface:Subscriber
Invoked after callingPublisher.subscribe(Subscriber)
.No data will start flowing until
Subscription.request(long)
is invoked.It is the responsibility of this
Subscriber
instance to callSubscription.request(long)
whenever more data is wanted.The
Publisher
will send notifications only in response toSubscription.request(long)
.- Specified by:
onSubscribe
in interfaceSubscriber<T>
- Parameters:
subscription
- theSubscription
that allows requesting data viaSubscription.request(long)
-
cancel
public void cancel()
-
-