-
Notifications
You must be signed in to change notification settings - Fork 534
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
Conversation
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. |
@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). |
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. |
Have merged but my connection is down.... Sent from my iPhone
|
Merged, discussions welcome. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove double-Inc. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no!
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. |
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`. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
@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 :) |
@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. |
Just a heads up, we're not at consensus yet so hold off cutting the release. |
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). |
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. |
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`" | |
There was a problem hiding this comment.
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).
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 ? |
…e to 1.15, 1.16, 1.17
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 .... |
👍 |
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:
|
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). |
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). |
@smaldini unfortunately I'm quite too busy atm to follow this stuff at all :( So don't wait on me, I trust you guys .... |
Moving forward then :) |
Docs tweaking and package info renaming in README.md