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

Prepare for 0.4.0.M1 #61

merged 25 commits into from
Jun 18, 2014

Conversation

smaldini
Copy link
Contributor

@smaldini smaldini commented Jun 2, 2014

Docs tweaking and package info renaming in README.md

@smaldini smaldini mentioned this pull request Jun 2, 2014
@benjchristensen
Copy link
Contributor

Before we proceed with this the specs and readme need to be merged (as discussed on Twitter). We should not have to mentally merge two documents in order to have "the contract".

It also seems odd to have a spec for the TCK, it should be just be asserting the spec/contract, not creating a new one. It can have a README explaining itself, but I don't think it should have a spec.

@viktorklang
Copy link
Contributor

@benjchristensen The reason for the spec residing in the TCK artifact was for the implementor to have access to an offline copy of the spec (since he'd use the TCK to verify his impl).

@benjchristensen
Copy link
Contributor

It's not hard to have an offline copy of a single file meant for the API and TCK. I strongly believe we need a single document representing the contract, not two.

The TCK artifacts can easily include whatever the single file is.

@smaldini
Copy link
Contributor Author

smaldini commented Jun 2, 2014

Have merged but my connection is down....

Sent from my iPhone

On 2 Jun 2014, at 18:41, Ben Christensen [email protected] wrote:

It's not hard to have an offline copy of a single file meant for the API and TCK. I strongly believe we need a single document representing the contract, not two.

The TCK artifacts can easily include whatever the single file is.


Reply to this email directly or view it on GitHub.

@smaldini
Copy link
Contributor Author

smaldini commented Jun 2, 2014

Merged, discussions welcome.

@benjchristensen
Copy link
Contributor

Thanks, I'll review ...

@@ -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. Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

remove double-Inc. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no!

@smaldini
Copy link
Contributor Author

smaldini commented Jun 3, 2014

BTW I didn't take time to explain how I merged, I just verified as much as I could duplicate rules and eliminate them then completed with rules that weren't present in README.md. Now it's up to us to decide whether some can go or not. Generally to me it sounds all right, I might wait for anyone else advice to double check the core behavior tho.

@jbrisbin
Copy link

jbrisbin commented Jun 3, 2014

I found having two different files confusing. We should explain the spec well enough that it's readable. IMO the spec should be the README and exist in only one place.

@@ -73,6 +74,16 @@ public interface Subscriber<T> {
- A `Subscriber` MUST NOT block a `Publisher` thread.
- A `Subscriber` MUST signal demand via `Subscription.request` to receive notifications.
- A `Subscriber` MAY behave synchronously or asynchronously but SHOULD NOT synchronously perform heavy computations in its methods (`onNext`, `onError`, `onComplete`, `onSubscribe`).
- A `Subscriber.onNext(T t)` and `Subscriber.onSubscribe(Subscription s)` MUST NOT call any methods on the `Subscription`, the `Publisher` or any other `Publishers` or `Subscribers`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about that @viktorklang @benjchristensen @jbrisbin

Copy link
Contributor

Choose a reason for hiding this comment

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

If the Subscriber is allowed synchronous, then this would be a weird rule (to me).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

| 10 | While the `Subscription` is not cancelled, `Subscription.request(int n)` MAY synchronously call `onNext` on this (or other) subscriber(s) |
| 11 | While the `Subscription` is not cancelled, `Subscription.request(int n)` MAY synchronously call `onComplete` or `onError` on this (or other) subscriber(s) |
| 12 | 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. |
| 13 | 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], but this specification does not mandate that it is disallowed since that would mean having to store previously canceled subscriptions indefinitely |
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't the portion about re-subscribing conflict with 2.12 that says onSubscribe can't be called more than once for a given Subscriber?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, in the spec-violating range of behaviors we have a conflict, but since it is outside of the conforming range I propose that we resolve this issue later (i.e. ticket as in “known bug”, not “contentious”). I created #63.

@smaldini
Copy link
Contributor Author

@reactive-streams/contributors - Most of the changes make sense here, that would be the last round (at least for this version). Before I commit the edited section as per @benjchristensen suggestions, let's focus on these last points, comment if wanted. It's not too late for releasing today :)

@viktorklang
Copy link
Contributor

@rkuhn and I are going to comment today, we're in rural Germany w/o decent connectivity so we'll have to do that later during the day.

@viktorklang
Copy link
Contributor

Just a heads up, we're not at consensus yet so hold off cutting the release.
After we reach consensus on this PR I suggest that we try to make individual PRs and discussions per suggested change so we don't end up with these massive changes.

@smaldini
Copy link
Contributor Author

Ok merging and releasing... Kidding :) My suggestion is to go with the PR without the changes proposed here with the latest comments and continue the discussion on the remaining big changes separately. Minus some loosening in the rules, its pretty much tiding up and not that far from 0.3 either specially its TDK (we could even give a kick at the current one and change just a few things, add more verifications and use rule number in tests).

@smaldini
Copy link
Contributor Author

So @reactive-streams/contributors should we have a consensus to merge the current branch, discuss release separately (or release now the simplified types as 0.4.0.M1), continue the discussion and release M2 with even fewer changes but closing outstanding tickets such as infinite request or precising capacity overflow rules.

@jbrisbin
Copy link

IMO we don't need complete agreement on all of the minor points to get moving forward. We can argue about the subtleties in subsequent issues related to specific areas of concern rather than holding up an entire codebase waiting for artifacts to be produced that never come due to the fact that we're never to going to agree on every detail.

👍

| 10 | `Publisher.subscribe` SHOULD NOT throw a non-fatal `Throwable`. The only legal way to signal failure (or reject a `Subscription`) is via the `onError` method. Non-fatal `Throwable` excludes any non-recoverable exception by the application (e.g. OutOfMemory) |
| 12 | `Publisher.subscribe` MAY be called as many times as wanted but MUST be with a different `Subscriber` each time [see 2.12]. It MUST 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 |
| 13 | A `Publisher` MAY support multi-subscribe and choose whether each `Subscription` is unicast or multicast |
| 14 | A `Publisher` MAY reject calls to its `subscribe` method if it is unable or unwilling to serve them (e.g. because it is overwhelmed or bounded by a finite number of underlying resources, etc...). If rejecting it MUST do this by calling `onError` on the `Subscriber` passed to `Publisher.subscribe` instead of calling `onSubscribe`" |
Copy link
Member

Choose a reason for hiding this comment

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

Please move the parenthesis out into a footnote and add more cases in which Subscribers may be rejected: when the Publisher cannot produce any more elements (exhausted a non-restartable source, shut down its resources; in general covering the cases from rules 15–17).

@rkuhn
Copy link
Member

rkuhn commented Jun 14, 2014

There are a few things which can be improved, as it entirely natural, so I agree with @jbrisbin that we can merge this PR as is. In keeping with the policy of doing small, clearly scoped changes one at a time I created tickets for outstanding fixes (#63, #64, #65, #66, #67, #68 and #69). This PR gives us a solid basis upon which to improve incrementally.

@mariusaeriksen @tmontgomery @purplefox @normanmaurer ?

@smaldini
Copy link
Contributor Author

It is time :) @purplefox @mariusaeriksen @tmontgomery @normanmaurer - I need your plus one to release as it so we can progress on #63, #64, #65, #66, #67, #68 and #69 ....

@tmontgomery
Copy link

👍

@benjchristensen
Copy link
Contributor

I'm okay with merging, but not releasing. The items listed above need to be resolved before releasing, and there are other open discussions without issues created:

#61 (comment)

+| 7 | A Subscriber MUST ensure that all calls on its Subscription take place from the same thread or provide for respective external synchronization |

#61 (comment)

+| 11 | A Subscriber MUST make sure that all calls on its onXXX methods happen-before [1] the processing of the respective signals. I.e. the Subscriber must take care of properly publishing the signal to its processing logic |

#61 (comment)

+| 2 | The Subscription MUST allow the Subscriber to call Subscription.request synchronously from within onNext or onSubscribe |

#61 (comment)

+| 14 | While the Subscription is not cancelled, invoking Subscription.cancel MAY cause the Publisher to transition into the shut-down state if no other Subscription exists at this point [see 1.17].

#61 (comment)

+| 3 | 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 |

@smaldini
Copy link
Contributor Author

As long as we don't have TCK, I don't see why we can't release in current state the 4 simplified classes. For sure the doc is going to receive several amendments until M2 or RC1 but that will drive the TCK work mainly which needs the M1 to start. I think its a solid base, apart from request(-1) I don't see a lot changing in the API jar artifact to release yet. WDYT ? I think the current README.md is a good starting point as all issues/comments are directly related to that base now (and there isn't a tck specific rules documents anymore).

@benjchristensen
Copy link
Contributor

Sorry, I mistook "release" to mean more ... if it's just releasing the jar as an artifact, I see no issue with that, it should have been done weeks ago, since 0.3 is already out there and it's wrong.

So I'm +1 on merging this, releasing code as 0.4, and then continuing to resolve the outstanding issues and discussions each on their own (with smaller PRs).

@normanmaurer
Copy link
Member

@smaldini unfortunately I'm quite too busy atm to follow this stuff at all :( So don't wait on me, I trust you guys ....

smaldini added a commit that referenced this pull request Jun 18, 2014
@smaldini smaldini merged commit 7a15ab6 into master Jun 18, 2014
@smaldini
Copy link
Contributor Author

Moving forward then :)

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.

8 participants