Skip to content

Commit de65e0d

Browse files
committed
Removes the RECOMMENDED section from 1.10
The reason is that it is not meaningful, as the same Subscriber could be subscribed to several *different* Publishers at the same time. The spec already requires that a Subscriber is only subscribed to one Publisher, and only once. And the spec also is clear that the only legal way to reject a Subscription in a Publisher is by issuing an `onError` signal to it.
1 parent 48ef44f commit de65e0d

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public interface Publisher<T> {
8787
| <a name="1.7">7</a> | Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further signals occur |
8888
| <a name="1.8">8</a> | If a `Subscription` is cancelled its `Subscriber` MUST eventually stop being signaled |
8989
| <a name="1.9">9</a> | Invoking `Publisher.subscribe` MUST return normally. The only legal way to signal failure (or reject a `Subscriber`) is via the `onError` method |
90-
| <a name="1.10">10</a> | `Publisher.subscribe` MAY be called as many times as wanted but MUST be with a different `Subscriber` each time [see [2.12](#2.12)]. It is RECOMMENDED to reject the `Subscription` with a `java.lang.IllegalStateException` if the same `Subscriber` already has an active `Subscription` with this `Publisher`. The cause message MUST include a reference to this rule and/or quote the full rule |
90+
| <a name="1.10">10</a> | `Publisher.subscribe` MAY be called as many times as wanted but MUST be with a different `Subscriber` each time [see [2.12](#2.12)] |
9191
| <a name="1.11">11</a> | A `Publisher` MAY support multi-subscribe and choose whether each `Subscription` is unicast or multicast |
9292
| <a name="1.12">12</a> | A `Publisher` MAY reject calls to its `subscribe` method if it is unable or unwilling to serve them [[1](#footnote-1-1)]. If rejecting it MUST do this by calling `onError` on the `Subscriber` passed to `Publisher.subscribe` instead of calling `onSubscribe` |
9393
| <a name="1.13">13</a> | A `Publisher` MUST produce the same elements, starting with the oldest element still available, in the same sequence for all its subscribers and MAY produce the stream elements at (temporarily) differing rates to different subscribers |

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

+2-10
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,9 @@ public void spec109_subscribeShouldNotThrowNonFatalThrowable() throws Throwable
381381
}
382382

383383
// Verifies rule: https://github.com/reactive-streams/reactive-streams#1.10
384-
@Additional @Test
384+
@NotVerified @Test
385385
public void spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice() throws Throwable {
386-
optionalActivePublisherTest(3, false, new PublisherTestRun<T>() {
387-
@Override
388-
public void run(final Publisher<T> pub) throws Throwable {
389-
ManualSubscriber<T> sub = env.newManualSubscriber(pub);
390-
391-
pub.subscribe(sub);
392-
sub.expectErrorWithMessage(IllegalStateException.class, "1.10"); // we do require implementations to mention the rule number at the very least
393-
}
394-
});
386+
notVerified(); // can we meaningfully test this?
395387
}
396388

397389
// Verifies rule: https://github.com/reactive-streams/reactive-streams#1.11

0 commit comments

Comments
 (0)