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: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The role of this group is detailed in the following, additions to this list are
22
22
Gatekeepers commit to the following:
23
23
24
24
1. 1-week SLA on :+1: or :-1: Pull Requests
25
-
* If a Gatekeeper will be unavailabile for a period of time, notify @reactive-streams/contributors and appoint who will vote in his/her place in the mean time
25
+
* If a Gatekeeper will be unavailable for a period of time, notify @reactive-streams/contributors and appoint who will vote in his/her place in the mean time
26
26
2. tag @reactive-streams/contributors with a deadline when there needs to be a vote on an Issue,
27
27
with at least 1 week of notice (see rule 1 above)
28
28
@@ -54,7 +54,7 @@ Follow these guidelines when creating public commits and writing commit messages
54
54
1. If your work spans multiple local commits (for example; if you do safe point commits while working in a feature branch or work in a branch for long time doing merges/rebases etc.) then please do not commit it all but rewrite the history by squashing the commits into a single big commit which you write a good commit message for (like discussed in the following sections). For more info read this article: [Git Workflow](http://sandofsky.com/blog/git-workflow.html). Every commit should be able to be used in isolation, cherry picked etc.
55
55
56
56
2. First line should be a descriptive sentence what the commit is doing. It should be possible to fully understand what the commit does—but not necessarily how it does it—by just reading this single line. We follow the “imperative present tense” style for commit messages ([more info here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
57
-
57
+
58
58
It is **not ok** to only list the ticket number, type "minor fix" or similar. In order to help with automatic filtering of the commit history (generating ChangeLogs, writing the migration guide, code archaeology) we use the following encoding:
59
59
60
60
3. Following the single line description should be a blank line followed by an enumerated list with the details of the commit. For very simple commits this may be empty.
Copy file name to clipboardExpand all lines: README.md
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,25 @@ The purpose of Reactive Streams is to provide a standard for asynchronous stream
4
4
5
5
The latest preview release is available on Maven Central as
6
6
7
-
<dependency>
8
-
<groupId>org.reactivestreams</groupId>
9
-
<artifactId>reactive-streams</artifactId>
10
-
<version>1.0.0.M1</version>
11
-
</dependency>
12
-
<dependency>
13
-
<groupId>org.reactivestreams</groupId>
14
-
<artifactId>reactive-streams-tck</artifactId>
15
-
<version>1.0.0.M1</version>
16
-
<scope>test</scope>
17
-
</dependency>
7
+
```xml
8
+
<dependency>
9
+
<groupId>org.reactivestreams</groupId>
10
+
<artifactId>reactive-streams</artifactId>
11
+
<version>1.0.0.M1</version>
12
+
</dependency>
13
+
<dependency>
14
+
<groupId>org.reactivestreams</groupId>
15
+
<artifactId>reactive-streams-tck</artifactId>
16
+
<version>1.0.0.M1</version>
17
+
<scope>test</scope>
18
+
</dependency>
19
+
```
18
20
19
21
## Goals, Design and Scope ##
20
22
21
23
Handling streams of data—especially “live” data whose volume is not predetermined—requires special care in an asynchronous system. The most prominent issue is that resource consumption needs to be carefully controlled such that a fast data source does not overwhelm the stream destination. Asynchrony is needed in order to enable the parallel use of computing resources, on collaborating network hosts or multiple CPU cores within a single machine.
22
24
23
-
The main goal of Reactive Streams is to govern the exchange of stream data across an asynchronous boundary – think passing elements on to another thread or thread-pool — while ensuring that the receiving side is not forced to buffer arbitrary amounts of data. In other words, backpressure is an integral part of this model in order to allow the queues which mediate between threads to be bounded. The benefits of asynchronous processing would be negated if the communication of backpressure were synchronous (see also the [Reactive Manifesto](http://reactivemanifesto.org/)), therefore care has been taken to mandate fully non-blocking and asynchronous behavior of all aspects of a Reactive Streams implementation.
25
+
The main goal of Reactive Streams is to govern the exchange of stream data across an asynchronous boundary – think passing elements on to another thread or thread-pool — while ensuring that the receiving side is not forced to buffer arbitrary amounts of data. In other words, backpressure is an integral part of this model in order to allow the queues which mediate between threads to be bounded. The benefits of asynchronous processing would be negated if the communication of backpressure were synchronous (see also the [Reactive Manifesto](http://reactivemanifesto.org/)), therefore care has been taken to mandate fully non-blocking and asynchronous behavior of all aspects of a Reactive Streams implementation.
24
26
25
27
It is the intention of this specification to allow the creation of many conforming implementations, which by virtue of abiding by the rules will be able to interoperate smoothly, preserving the aforementioned benefits and characteristics across the whole processing graph of a stream application.
26
28
@@ -35,7 +37,7 @@ In summary, Reactive Streams is a standard and specification for Stream-oriented
35
37
36
38
The Reactive Streams specification consists of the following parts:
37
39
38
-
**The API** specifies the types to implement Reactive Streams and achieve interoperablility between different implementations.
40
+
***The API*** specifies the types to implement Reactive Streams and achieve interoperability between different implementations.
39
41
40
42
***The Technology Compatibility Kit (TCK)*** is a standard test suite for conformance testing of implementations.
41
43
@@ -81,8 +83,8 @@ public interface Publisher<T> {
81
83
|<a name="1.3">3</a>| `onSubscribe`, `onNext`, `onError` and `onComplete` signaled to a `Subscriber` MUST be signaled sequentially (no concurrent notifications) |
82
84
|<a name="1.4">4</a>|If a `Publisher` fails it MUST signal an `onError` |
83
85
|<a name="1.5">5</a>|If a `Publisher` terminates successfully (finite stream) it MUST signal an `onComplete` |
84
-
|<a name="1.6">6</a>|If a `Publisher` signals either `onError` or `onComplete` on a `Subscriber`, that `Subscriber`’s `Subscription` MUST be considered canceled|
85
-
|<a name="1.7">7</a>|Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further signals occur
86
+
|<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|
87
+
|<a name="1.7">7</a>|Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further signals occur|
86
88
|<a name="1.8">8</a>|If a `Subscription` is cancelled its `Subscriber` MUST eventually stop being signaled |
87
89
|<a name="1.9">9</a>|Invoking `Publisher.subscribe` MUSTreturn normally. The only legal way to signal failure (or reject a `Subscriber`) is via the `onError` method |
88
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 |
@@ -144,7 +146,7 @@ public interface Subscription {
144
146
| <a name="3.10">10</a> | While the `Subscription` is not cancelled, `Subscription.request(long n)` MAY synchronously call `onNext` on this (or other) subscriber(s) |
145
147
| <a name="3.11">11</a> | While the `Subscription` is not cancelled, `Subscription.request(long n)` MAY synchronously call `onComplete` or `onError` on this (or other) subscriber(s) |
146
148
| <a name="3.12">12</a> | While the `Subscription` is not cancelled, `Subscription.cancel()` MUST request the `Publisher` to eventually stop signaling its `Subscriber`. The operation is NOT REQUIRED to affect the `Subscription` immediately. |
147
-
| <a name="3.13">13</a> | While the `Subscription` is not cancelled, `Subscription.cancel()` MUST request the `Publisher` to eventually drop any references to the corresponding subscriber. Re-subscribing with the same `Subscriber` object is discouraged [see [2.12](#2.12)], but this specification does not mandate that it is disallowed since that would mean having to store previously canceled subscriptions indefinitely |
149
+
| <a name="3.13">13</a> | While the `Subscription` is not cancelled, `Subscription.cancel()` MUST request the `Publisher` to eventually drop any references to the corresponding subscriber. Re-subscribing with the same `Subscriber` object is discouraged [see [2.12](#2.12)], but this specification does not mandate that it is disallowed since that would mean having to store previously cancelled subscriptions indefinitely |
148
150
| <a name="3.14">14</a> | While the `Subscription` is not cancelled, invoking `Subscription.cancel` MAY cause the `Publisher`, if stateful, to transition into the `shut-down` state if no other `Subscription` exists at this point [see [1.13](#1.13)].
149
151
| <a name="3.15">15</a> | `Subscription.cancel` MUST NOT throw an `Exception` and MUST signal `onError` to its `Subscriber` |
150
152
| <a name="3.16">16</a> | `Subscription.request` MUST NOT throw an `Exception` and MUST signal `onError` to its `Subscriber` |
| <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 |
167
-
| <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 |
169
+
| <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` cancelled, otherwise it MUST propagate the `onError` signal to its Subscribers immediately |
168
170
169
171
While not mandated, it can be a good idea to cancel a `Processors` upstream `Subscription` when/if its last `Subscriber` cancels their `Subscription`,
170
172
to let the cancellation signal propagate upstream.
@@ -210,14 +212,13 @@ The Reactive Streams contract allows implementations the flexibility to manage r
210
212
211
213
In order to allow fully asynchronous implementations of all participating API elements—`Publisher`/`Subscription`/`Subscriber`/`Processor`—all methods defined by these interfaces return `void`.
212
214
213
-
214
215
### Subscriber controlled queue bounds ###
215
216
216
217
One of the underlying design principles is that all buffer sizes are to be bounded and these bounds must be *known* and *controlled* by the subscribers. These bounds are expressed in terms of *element count* (which in turn translates to the invocation count of onNext).Any implementation that aims to support infinite streams (especially high output rate streams) needs to enforce bounds all along the way to avoid out-of-memory errors and constrain resource usage in general.
217
218
218
219
Since back-pressure is mandatory the use of unbounded buffers can be avoided. In general, the only time when a queue might grow without bounds is when the publisher side maintains a higher rate than the subscriber for an extended period of time, but this scenario is handled by backpressure instead.
219
220
220
-
Queue bounds can be controlled by a subscriber by signaling demand for the appropriate number of elements. At any point in time the subscriber knows:
221
+
Queue bounds can be controlled by a subscriber signaling demand for the appropriate number of elements. At any point in time the subscriber knows:
221
222
222
223
- the total number of elements requested: `P`
223
224
- the number of elements that have been processed: `N`
0 commit comments