You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,12 @@ A *Publisher* is a provider of a potentially unbounded number of sequenced eleme
57
57
In response to a call to `Publisher.subscribe(Subscriber)` the possible invocation sequences for methods on the `Subscriber` are given by the following protocol:
This means that `onSubscribe` is always signalled,
64
+
followed by a possibly unbounded number of `onNext` signals (as requested by `Subscriber`) followed by an `onError` signal if there is a failure, or an `onComplete` signal when no more elements are available—all as long as the `Subscription` is not cancelled.
65
+
63
66
#### NOTES
64
67
65
68
- The specifications below use binding words in capital letters from https://www.ietf.org/rfc/rfc2119.txt
@@ -87,10 +90,10 @@ public interface Publisher<T> {
87
90
|<a name="1.6">6</a>|If a `Publisher` signals either `onError` or `onComplete` on a `Subscriber`, that `Subscriber`’s `Subscription` MUST be considered cancelled. |
88
91
|<a name="1.7">7</a>|Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further signals occur. |
89
92
|<a name="1.8">8</a>|If a `Subscription` is cancelled its `Subscriber` MUST eventually stop being signaled. |
90
-
|<a name="1.9">9</a>|Calling`Publisher.subscribe` MUSTreturn normally except when the provided `Subscriber` is `null` in which case it MUSTthrow a `java.lang.NullPointerException` to the caller, for all other situations the only legal way to signal failure (or reject a `Subscriber`) is via the `onError` method. |
93
+
|<a name="1.9">9</a>| `Publisher.subscribe` MUSTsignal `onSubscribe` on the provided `Subscriber` prior to any other signals to that `Subscriber` and MUSTreturn normally, except when the provided `Subscriber` is `null` in which case it MUSTthrow a `java.lang.NullPointerException` to the caller, for all other situations the only legal way to signal failure (or reject the `Subscriber`) is by calling `onError` (after calling `onSubscribe`).|
91
94
|<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)].|
92
95
|<a name="1.11">11</a>|A `Publisher` MAY support multi-subscribe and choose whether each `Subscription` is unicast or multicast. |
93
-
|<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 MUSTdothis by calling `onError` on the `Subscriber` passed to `Publisher.subscribe` instead of calling `onSubscribe`.|
96
+
|<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 MUSTdothis by calling `onError` on the `Subscriber` passed to `Publisher.subscribe` after calling `onSubscribe`.|
94
97
|<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. |
95
98
96
99
[<a name="footnote-1-1">1</a>] :A stateful Publisher can be overwhelmed, bounded by a finite number of underlying resources, exhausted, shut-down or in a failed state.
0 commit comments