Skip to content

Prepare for 0.4.0.M1 #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jun 18, 2014
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CopyrightWaivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ github name | Real Name, Email Address used for git commits, Company
rkuhn | Roland Kuhn, [email protected], Typesafe Inc.
benjchristensen| Ben Christensen, [email protected], Netflix Inc.
viktorklang | Viktor Klang, [email protected], Typesafe Inc.
smaldini | Stephane Maldini, [email protected], Pivotal Software Inc.
142 changes: 96 additions & 46 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name := "reactive-streams-api"
name := "reactive-streams"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkuhn @viktorklang is there going to be any issue into publishing the artifact this way ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I’d know (example: JUnit).


javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.6", "-target", "1.6", "-Xlint:unchecked", "-Xlint:deprecation")

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/reactivestreams/Publisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface Publisher<T> {
* If the {@link Publisher} rejects the subscription attempt or otherwise fails it will
* signal the error via {@link Subscriber#onError}.
*
* @param s
* @param s the {@link Subscriber} that will consume signals from this {@link Publisher}
*/
public void subscribe(Subscriber<T> s);
}
12 changes: 6 additions & 6 deletions api/src/main/java/org/reactivestreams/Subscriber.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* After signaling demand:
* <ul>
* <li>One or more invocations of {@link #onNext(Object)} up to the maximum number defined by {@link Subscription#request(int)}</li>
* <li>Single invocation of {@link #onError(Throwable)} or {@link #onCompleted()} which signals a terminal state after which no further events will be sent.
* <li>Single invocation of {@link #onError(Throwable)} or {@link Subscriber#onComplete()} which signals a terminal state after which no further events will be sent.
* </ul>
* <p>
* Demand can be signalled via {@link Subscription#request(int)} whenever the {@link Subscriber} instance is capable of handling more.
* Demand can be signaled via {@link Subscription#request(int)} whenever the {@link Subscriber} instance is capable of handling more.
*
* @param <T>
* @param <T> the Type of element signaled.
*/
public interface Subscriber<T> {
/**
Expand All @@ -33,16 +33,16 @@ public interface Subscriber<T> {
/**
* Data notification sent by the {@link Publisher} in response to requests to {@link Subscription#request(int)}.
*
* @param t
* @param t the element signaled
*/
public void onNext(T t);

/**
* Failed terminal state.
* <p>
* No further events will be sent even if {@link Subscription#request(int)} is invoked again.
*
* @param t
*
* @param t the throwable signaled
*/
public void onError(Throwable t);

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/reactivestreams/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface Subscription {
* A {@link Publisher} can send less than is requested if the stream ends but
* then must emit either {@link Subscriber#onError(Throwable)} or {@link Subscriber#onComplete()}.
*
* @param n
* @param n the strictly positive number of elements to requests to the upstream {@link Publisher}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about support a negative number to give freedom to the publisher to firehose data as fast as it wants without limits?

An example use case is when a Subscriber is doing sampling or other time-based operations. In those cases, request(n) doesn't make much sense, so with a positive requirement it would effectively just do request(Integer.MAX_VALUE) and call that occasionally to keep it "topped off" and risk overflows. Or, we just say that a number <0 means there is no limit to the number that can be sent as that means there is no buffer to overflow, or the subscriber will handle it in its own way.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot. I'v been thinking the same thing about Integer.MAX_VALUE and how that would be noisy in code (and annoying to work with because it would have to be called periodically) compared to request(-1).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you wish as long as we reach consensus, I thought we discussed that before and there were some arguments in favor of staying that way. I may not foresee everything but right now in Reactor it just forces us to loop Integer.MAX-VALUE requests for never ending consumers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let us clarify this in a separate discussion, this is an orthogonal issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left unchanged for the next push.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening an issue to discuss this here: #62

*/
public void request(int n);

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
organization in ThisBuild := "org.reactivestreams"

version in ThisBuild := "0.4-SNAPSHOT"
version in ThisBuild := "0.4.0.M1"

scalaVersion in ThisBuild := "2.10.3"

Expand Down
3 changes: 0 additions & 3 deletions tck/src/main/resources/spec.md

This file was deleted.