GitHub PullRequestReviewCommentEvent at 2014-06-05 17:22:10
Repository: reactive-streams
Actor: benjchristensen
Payload: {"comment":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/13452224","id":13452224,"diff_hunk":"@@ -83,24 +81,55 @@ public interface Publisher<T> {\n }\r\n ````\r\n \r\n-- The number of `onNext` events emitted by a `Publisher` to a `Subscriber` MUST NOT exceed the cumulative demand that has been signaled via that `Subscriber`’s `Subscription`.\r\n-- A `Publisher` MAY send less events than requested and terminate the `Subscription` by calling `onComplete` or `onError`.\r\n-- Events sent to a `Subscriber` MUST be sent sequentially (no concurrent notifications).\r\n-- If a `Publisher` fails it MUST emit an `onError`.\r\n-- If a `Publisher` terminates successfully (finite stream) it MUST emit an `onComplete`.\r\n-- If a Publisher signals either `onError` or `onComplete` on a `Subscriber`, that `Subscriber`’s `Subscription` MUST be considered canceled.\r\n-- Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further events can be sent.\r\n-- Upon receiving a `Subscription.cancel` request it SHOULD stop sending events as soon as it can. \r\n-- `Subscription`'s which have been canceled SHOULD NOT receive subsequent `onError` or `onComplete` events, but implementations will not be able to strictly guarantee this in all cases due to the intrinsic race condition between actions taken concurrently by `Publisher` and `Subscriber`.\r\n-- A `Publisher` SHOULD NOT throw an `Exception`. The only legal way to signal failure (or reject a `Subscription`) is via the `Subscriber.onError` method.\r\n-- The `Subscriber.onSubscribe` method on a given `Subscriber` instance MUST NOT be called more than once.\r\n-- The `Publisher.subscribe` method MAY be called as many times as wanted but MUST be with a different `Subscriber` each time. \r\n-- A `Publisher` MAY support multi-subscribe and choose whether each `Subscription` is unicast or multicast.\r\n-- 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`\".\r\n-\r\n+| ID     | Rule                                                                                                   |\r\n+| ------ | ------------------------------------------------------------------------------------------------------ |\r\n+| 1      | The number of `onNext` signaled by a `Publisher` to a `Subscriber` MUST NOT exceed the cumulative demand that has been signaled via that `Subscriber`’s `Subscription` |\r\n+| 2      | A `Publisher` MAY signal less `onNext` than requested and terminate the `Subscription` by calling `onComplete` or `onError` |\r\n+| 3      | Events signaled to a `Subscriber` MUST be signaled sequentially (no concurrent notifications) |\r\n+| 4      | If a `Publisher` fails it MUST signal an `onError` |\r\n+| 5      | If a `Publisher` terminates successfully (finite stream) it MUST signal an `onComplete` |\r\n+| 6      | If a Publisher signals either `onError` or `onComplete` on a `Subscriber`, that `Subscriber`’s `Subscription` MUST be considered canceled |\r\n+| 7      | Once a terminal state has been signaled (`onError`, `onComplete`) it is REQUIRED that no further signals occur |\r\n+| 8      | Upon receiving a `Subscription.cancel` request it SHOULD, as soon as it can, stop signaling its `Subscriber` |\r\n+| 9      | `Subscription`'s which have been canceled SHOULD NOT receive subsequent `onError` or `onComplete` signals, but implementations will not be able to strictly guarantee this in all cases due to the intrinsic race condition between actions taken concurrently by `Publisher` and `Subscriber` |\r\n+| 10     | A `Publisher` SHOULD NOT throw an `Exception`. The only legal way to signal failure (or reject a `Subscription`) is via the `Subscriber.onError` method. _[Under Discussion]_ |\r","path":"README.md","position":100,"original_position":100,"commit_id":"5b02393a928de69da4bff1227a6540a5d305a484","original_commit_id":"5b02393a928de69da4bff1227a6540a5d305a484","user":{"login":"benjchristensen","id":813492,"avatar_url":"https://avatars.githubusercontent.com/u/813492?","gravatar_id":"25a69d1e333ff36b77cf01b84b764182","url":"https://api.github.com/users/benjchristensen","html_url":"https://github.com/benjchristensen","followers_url":"https://api.github.com/users/benjchristensen/followers","following_url":"https://api.github.com/users/benjchristensen/following{/other_user}","gists_url":"https://api.github.com/users/benjchristensen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjchristensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjchristensen/subscriptions","organizations_url":"https://api.github.com/users/benjchristensen/orgs","repos_url":"https://api.github.com/users/benjchristensen/repos","events_url":"https://api.github.com/users/benjchristensen/events{/privacy}","received_events_url":"https://api.github.com/users/benjchristensen/received_events","type":"User","site_admin":false},"body":"Is it under discussion whether a `Publisher` throws? Maybe it's just semantics, but it seems it's only the `Subscriber` that may throw and have no recourse. A `Publisher` should never need to throw, it would emit via `onError`. It's only if the `onError` blows up and throws that `Publisher` let's that throw as it can't do anything about it at that point. ","created_at":"2014-06-05T17:22:10Z","updated_at":"2014-06-05T17:22:10Z","html_url":"https://github.com/reactive-streams/reactive-streams/pull/61#discussion_r13452224","pull_request_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/13452224"},"html":{"href":"https://github.com/reactive-streams/reactive-streams/pull/61#discussion_r13452224"},"pull_request":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/61"}}}}