Skip to content

Commit 65b95b2

Browse files
jroperviktorklang
authored andcommitted
Clarified the expected behaviour for triggerRequest (#442)
This addresses some of the problem raised in #280.
1 parent 0d9418d commit 65b95b2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Diff for: tck/src/main/java/org/reactivestreams/tck/SubscriberWhiteboxVerification.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,23 @@ public interface SubscriberProbe<T> {
795795
* make implement these calls.
796796
*/
797797
public interface SubscriberPuppet {
798+
798799
/**
799-
* Trigger {@code request(elements)} on your {@link Subscriber}
800+
* Ensure that at least {@code elements} are eventually requested by your {@link Subscriber}, if it hasn't already
801+
* requested that many elements.
802+
* <p>
803+
* This does not necessarily have to correlate 1:1 with a {@code Subscription.request(elements)} call, but the sum
804+
* of the elements requested by your {@code Subscriber} must eventually be at least the the sum of the elements
805+
* triggered to be requested by all the invocations of this method.
806+
* <p>
807+
* Additionally, subscribers are permitted to delay requesting elements until previous requests for elements have
808+
* been fulfilled. For example, a subscriber that only requests one element at a time may fulfill the request made
809+
* by this method by requesting one element {@code elements} times, waiting for each element to arrive before the
810+
* next request is made.
811+
* <p>
812+
* Before sending any element to the subscriber, the TCK must wait for the subscriber to request that element, and
813+
* must be prepared for the subscriber to only request one element at a time, it is not enough for the TCK to
814+
* simply invoke this method before sending elements.
800815
*/
801816
void triggerRequest(long elements);
802817

0 commit comments

Comments
 (0)