From 0ae3dcb3a468cf496e948dbe500793512e63d5f6 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 27 Sep 2014 17:58:31 +0200 Subject: [PATCH] Fixes #114 by removing the outdated test in the TCK and adding guideline for cancellation propagation for Processor to the README. --- README.md | 3 +++ .../tck/IdentityProcessorVerification.java | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c7cc5c3b..8c8469e1 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,9 @@ public interface Processor extends Subscriber, Publisher { | 1 | A `Processor` represents a processing stage—which is both a `Subscriber` and a `Publisher` and MUST obey the contracts of both [1] | | 2 | 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 | +While not mandated, it can be a good idea to cancel a `Processors` upstream `Subscription` when/if its last `Subscriber` cancels their `Subscription`, +to let the cancellation signal propagate upstream. + ### Asynchronous vs Synchronous Processing ### 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. diff --git a/tck/src/main/java/org/reactivestreams/tck/IdentityProcessorVerification.java b/tck/src/main/java/org/reactivestreams/tck/IdentityProcessorVerification.java index 1e55407c..44d7b010 100644 --- a/tck/src/main/java/org/reactivestreams/tck/IdentityProcessorVerification.java +++ b/tck/src/main/java/org/reactivestreams/tck/IdentityProcessorVerification.java @@ -426,19 +426,6 @@ public void onError(Throwable cause) { ////////////////////// OTHER RULE VERIFICATION /////////////////////////// - // A Processor - // must cancel its upstream Subscription if its last downstream Subscription has been cancelled - @Test - public void mustCancelItsUpstreamSubscriptionIfItsLastDownstreamSubscriptionHasBeenCancelled() throws Exception { - new TestSetup(env, processorBufferSize) {{ - final ManualSubscriber sub = newSubscriber(); - sub.cancel(); - expectCancelling(); - - env.verifyNoAsyncErrors(); - }}; - } - // A Processor // must immediately pass on `onError` events received from its upstream to its downstream @Test