Skip to content

2.6 refinement/explanation #321

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

Closed
anthonyvdotbe opened this issue Apr 11, 2016 · 1 comment
Closed

2.6 refinement/explanation #321

anthonyvdotbe opened this issue Apr 11, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@anthonyvdotbe
Copy link
Contributor

§2.6 says:

A Subscriber MUST call Subscription.cancel() if it is no longer valid to the Publisher without the Publisher having signaled onError or onComplete.

To me, it's unclear what it means for a Subscriber to be "valid to the Publisher". This was explained by @viktorklang as:

If the "downstream" completes or errors before the "upstream". Imagine for instance a Processor which only wants the first element from its "upstream". Or a Subscriber which receives a "forbidden" value. etc.

which makes sense, but I don't get that from reading the rule. I believe there are 2 issues:

  • the word "valid": I don't see why, for example, a Processor which only wants the first element from its "upstream" would be any more valid/invalid than a Processor who wants all elements
  • the phrase "to the Publisher": this implies to me that there's a validity relation with the Publisher (i.e. a Subscriber can be in a state of "valid, but invalid to its Publisher")

For reference, the current wording was introduced in ec7c3bd, where it previously was:

A Subscriber MUST call Subscription.cancel() during shutdown if it still has an active Subscription.

Hereby, I want to propose the following:

A Subscriber MUST call Subscription.cancel() if it no longer has an interest in receiving signals from its Publisher and the Subscription is not considered cancelled yet.

Note that this also rephrases the last part of the rule, saying and the Subscription is not considered cancelled yet instead of without the Publisher having signaled onError or onComplete. The former is slightly more general, as there may be other conditions under which a Subscriber must consider its Subscription cancelled.

The explanation of the rule would then give concrete examples of cases where the Subscriber would no longer have such an interest (such as those given by @viktorklang above). And it would reference §2.4 as an example of when a Subscription is considered cancelled.

@viktorklang
Copy link
Contributor

This rule has been explained in the rationales.

@viktorklang viktorklang self-assigned this May 22, 2017
@viktorklang viktorklang added this to the 1.0.1 milestone May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants