Package org.reactivestreams.tck
Class TestEnvironment.ManualPublisher<T>
java.lang.Object
org.reactivestreams.tck.TestEnvironment.ManualPublisher<T>
- All Implemented Interfaces:
Publisher<T>
- Direct Known Subclasses:
IdentityProcessorVerification.TestSetup
,SubscriberBlackboxVerification.BlackboxTestStage
,SubscriberWhiteboxVerification.WhiteboxTestStage
- Enclosing class:
TestEnvironment
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TestEnvironment.Latch
protected final TestEnvironment
protected long
protected final TestEnvironment.Receptacle
<Long> protected TestEnvironment.Promise
<Subscriber<? super T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
expectCancelling
(long timeoutMillis) void
expectExactRequest
(long expected) void
expectExactRequest
(long expected, long timeoutMillis) void
void
expectNoRequest
(long timeoutMillis) long
long
expectRequest
(long timeoutMillis) long
expectRequest
(long timeoutMillis, String errorMessageAddendum) boolean
void
void
void
void
subscribe
(Subscriber<? super T> s) RequestPublisher
to start streaming data.
-
Field Details
-
env
-
pendingDemand
protected long pendingDemand -
subscriber
-
requests
-
cancelled
-
-
Constructor Details
-
ManualPublisher
-
-
Method Details
-
subscribe
Description copied from interface:Publisher
RequestPublisher
to start streaming data.This is a "factory method" and can be called multiple times, each time starting a new
Subscription
.Each
Subscription
will work for only a singleSubscriber
.A
Subscriber
should only subscribe once to a singlePublisher
.If the
Publisher
rejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(Throwable)
.- Specified by:
subscribe
in interfacePublisher<T>
- Parameters:
s
- theSubscriber
that will consume signals from thisPublisher
-
sendNext
-
sendCompletion
public void sendCompletion() -
sendError
-
expectRequest
- Throws:
InterruptedException
-
expectRequest
- Throws:
InterruptedException
-
expectRequest
public long expectRequest(long timeoutMillis, String errorMessageAddendum) throws InterruptedException - Throws:
InterruptedException
-
expectExactRequest
- Throws:
InterruptedException
-
expectExactRequest
- Throws:
InterruptedException
-
expectNoRequest
- Throws:
InterruptedException
-
expectNoRequest
- Throws:
InterruptedException
-
expectCancelling
- Throws:
InterruptedException
-
expectCancelling
- Throws:
InterruptedException
-
isCancelled
- Throws:
InterruptedException
-