Skip to content

document rationale for void return of subscribe() #51

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 1 commit into from
Jun 3, 2014

Conversation

rkuhn
Copy link
Member

@rkuhn rkuhn commented May 12, 2014

fixes #43

@@ -90,7 +92,9 @@ In addition there is one method each on Producer and Consumer to obtain a refere

The Reactive Streams SPI prescribes that all processing of elements (onNext) or termination signals (onError, onComplete) happens outside of the execution stack of the Publisher. This is achieved by scheduling the processing to run asynchronously, possibly on a different thread. The Subscriber should make sure to minimize the amount of processing steps used to initiate this process, meaning that all its SPI-mandated methods shall return as quickly as possible.

In contrast to communicating back-pressure by blocking the publisher, a non-blocking solution needs to communicate demand through a dedicated control channel. This channel is provided by the Subscription: the subscriber controls the maximum amount of future elements it is willing receive by sending explicit demand tokens (by calling requestMore(int)).
In contrast to communicating back-pressure by blocking the publisher, a non-blocking solution needs to communicate demand through a dedicated control channel. This channel is provided by the Subscription: the subscriber controls the maximum amount of future elements it is willing receive by sending explicit demand tokens (by calling requestMore(int)).
Copy link
Member Author

Choose a reason for hiding this comment

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

this line is signaled as changed because my editor removed the before its end; we should settle on Unix line encoding and fix the text files at some point

@rkuhn
Copy link
Member Author

rkuhn commented May 20, 2014

Is this change good to go?

@benjchristensen
Copy link
Contributor

It's conflicting with the README merge that just went in.

@rkuhn
Copy link
Member Author

rkuhn commented May 20, 2014

Moved the sentences to their new locations and pushed a rebase: there were no LGTMs that could have been invalidated.

@mariusae
Copy link

LGTM

1 similar comment
@viktorklang
Copy link
Contributor

LGTM

@rkuhn
Copy link
Member Author

rkuhn commented Jun 2, 2014

@reactive-streams/contributors can this go in?

@jbrisbin
Copy link

jbrisbin commented Jun 2, 2014

👍

1 similar comment
@smaldini
Copy link
Contributor

smaldini commented Jun 2, 2014

+1

@tmontgomery
Copy link

LGTM

@@ -157,6 +156,7 @@ All of these variants are "asynchronous streams". They all have their place and

The Reactive Streams contract allows implementations the flexibility to manage resources and scheduling and mix asynchronous and synchronous processing within the bounds of a non-blocking, asynchronous, push-based stream.

In order to allow fully asynchronous implementations of all participating SPI elements—`Publisher`/`Subscription`/`Subscriber`—all methods defined by these interfaces return `void`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The README currently only uses the term API but this uses SPI. Is that on purpose? Does it confuse things?

@benjchristensen
Copy link
Contributor

I'm good with these changes. Only possible thing to change is SPI/API term.

@smaldini
Copy link
Contributor

smaldini commented Jun 3, 2014

I'll finalize on 0.4.0.M1 PR #61 @benjchristensen

smaldini added a commit that referenced this pull request Jun 3, 2014
document rationale for void return of subscribe()
@smaldini smaldini merged commit f599155 into reactive-streams:master Jun 3, 2014
smaldini pushed a commit that referenced this pull request Jun 3, 2014
@rkuhn
Copy link
Member Author

rkuhn commented Jun 6, 2014

Thanks, @smaldini !

@rkuhn rkuhn deleted the wip-void-subscribe-rk branch June 6, 2014 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnSubscribe vs return Subscription
7 participants