Skip to content

Commit 5b49919

Browse files
committed
Fixes #114 by removing the outdated test in the TCK and adding guideline for cancellation propagation for Processor to the README.
1 parent 96a4a0a commit 5b49919

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {
167167
| <a name="4.1">1</a> | A `Processor` represents a processing stage—which is both a `Subscriber` and a `Publisher` and MUST obey the contracts of both [1] |
168168
| <a name="4.2">2</a> | A `Processor` MAY choose to recover an `onError` signal. If it chooses to do so, it MUST consider the `Subscription` canceled, otherwise it MUST propagate the `onError` signal to its Subscribers immediately |
169169
170+
While not mandated, it can be a good idea to cancel a `Processors` upsteam `Subscription` when/if its last `Subscriber` cancels their `Subscription`,
171+
to let the cancellation signal propagate upstream.
172+
170173
### Asynchronous vs Synchronous Processing ###
171174
172175
The Reactive Streams API prescribes that all processing of elements (`onNext`) or termination signals (`onError`, `onComplete`) MUST NOT *block* the `Publisher`. However, each of the `on*` handlers can process the events synchronously or asynchronously.

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

-13
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,6 @@ public void onError(Throwable cause) {
426426

427427
////////////////////// OTHER RULE VERIFICATION ///////////////////////////
428428

429-
// A Processor
430-
// must cancel its upstream Subscription if its last downstream Subscription has been cancelled
431-
@Test
432-
public void mustCancelItsUpstreamSubscriptionIfItsLastDownstreamSubscriptionHasBeenCancelled() throws Exception {
433-
new TestSetup(env, processorBufferSize) {{
434-
final ManualSubscriber<T> sub = newSubscriber();
435-
sub.cancel();
436-
expectCancelling();
437-
438-
env.verifyNoAsyncErrors();
439-
}};
440-
}
441-
442429
// A Processor
443430
// must immediately pass on `onError` events received from its upstream to its downstream
444431
@Test

0 commit comments

Comments
 (0)