Skip to content

Commit f9493e3

Browse files
jroperviktorklang
authored andcommitted
Allow triggerRequest and signalCancel to be coalesced (#462)
See #453 and #441 (comment)
1 parent a3f4494 commit f9493e3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tck/src/main/java/org/reactivestreams/tck/SubscriberWhiteboxVerification.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ public void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCall
266266
@Override
267267
public void run(WhiteboxTestStage stage) throws InterruptedException {
268268
stage.puppet().triggerRequest(1);
269-
stage.puppet().signalCancel();
270269
stage.expectRequest();
270+
stage.puppet().signalCancel();
271+
stage.expectCancelling();
271272
stage.signalNext();
272273

273274
stage.puppet().triggerRequest(1);
@@ -812,11 +813,17 @@ public interface SubscriberPuppet {
812813
* Before sending any element to the subscriber, the TCK must wait for the subscriber to request that element, and
813814
* must be prepared for the subscriber to only request one element at a time, it is not enough for the TCK to
814815
* simply invoke this method before sending elements.
816+
* <p>
817+
* An invocation of {@link #signalCancel()} may be coalesced into any elements that have not yet been requested,
818+
* such that only a cancel signal is emitted.
815819
*/
816820
void triggerRequest(long elements);
817821

818822
/**
819-
* Trigger {@code cancel()} on your {@link Subscriber}
823+
* Trigger {@code cancel()} on your {@link Subscriber}.
824+
* <p/>
825+
* An invocation of this method may be coalesced into any outstanding requests, as requested by
826+
* {@link #triggerRequest(long)}, such that only a cancel signal is emitted.
820827
*/
821828
void signalCancel();
822829
}

0 commit comments

Comments
 (0)