{"action":"created","issue":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/410","repository_url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm","labels_url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/410/comments","events_url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/410/events","html_url":"https://github.com/reactive-streams/reactive-streams-jvm/issues/410","id":272637121,"node_id":"MDU6SXNzdWUyNzI2MzcxMjE=","number":410,"title":"Compliance with Rule 2.5","user":{"login":"pavelrappo","id":32523691,"node_id":"MDQ6VXNlcjMyNTIzNjkx","avatar_url":"https://avatars2.githubusercontent.com/u/32523691?v=4","gravatar_id":"","url":"https://api.github.com/users/pavelrappo","html_url":"https://github.com/pavelrappo","followers_url":"https://api.github.com/users/pavelrappo/followers","following_url":"https://api.github.com/users/pavelrappo/following{/other_user}","gists_url":"https://api.github.com/users/pavelrappo/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelrappo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelrappo/subscriptions","organizations_url":"https://api.github.com/users/pavelrappo/orgs","repos_url":"https://api.github.com/users/pavelrappo/repos","events_url":"https://api.github.com/users/pavelrappo/events{/privacy}","received_events_url":"https://api.github.com/users/pavelrappo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-11-09T16:55:25Z","updated_at":"2018-08-20T10:26:56Z","closed_at":"2017-11-17T09:50:43Z","author_association":"NONE","body":"> A `Subscriber` MUST call `Subscription.cancel()` on the given `Subscription` after an `onSubscribe` signal if it already has an active `Subscription`.\r\n\r\nI think it's worth pointing out in examples (and may be even producing a TCK test), that subscribers must use appropriate synchronization in `onSubscribe`. Even though there is rule 1.3:\r\n\r\n> `onSubscribe`, `onNext`, `onError` and `onComplete` signaled to a `Subscriber` MUST be signaled in a thread-safe manner—and if performed by multiple threads—use external synchronization.\r\n\r\nmultiple `Publishers` may not coordinate their actions for a subscriber, thus `onSubscribe` may be called concurrently even though each of the publishers call it in a thread-safe manner. Worst-case\r\nscenario -- many publishers end up signalling this subscriber's methods concurrently and in an incoherent manner.\r\n\r\nFor example, synchronous subscriber could use something like this:\r\n\r\n```java\r\npublic class MySubscriber<T> implements Subscriber<T> {\r\n\r\n    private final AtomicBoolean hasSubscription = new AtomicBoolean();\r\n    private Subscription subscription;\r\n\r\n    @Override\r\n    public void onSubscribe(Subscription s) {\r\n        Objects.requireNonNull(s);\r\n        if (!hasSubscription.compareAndSet(false, true)) {\r\n            s.cancel();\r\n        } else {\r\n            subscription = s;\r\n            // ...\r\n        }\r\n    }\r\n    // ..\r\n}\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/comments/414270197","html_url":"https://github.com/reactive-streams/reactive-streams-jvm/issues/410#issuecomment-414270197","issue_url":"https://api.github.com/repos/reactive-streams/reactive-streams-jvm/issues/410","id":414270197,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDI3MDE5Nw==","user":{"login":"thekalinga","id":452518,"node_id":"MDQ6VXNlcjQ1MjUxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/452518?v=4","gravatar_id":"","url":"https://api.github.com/users/thekalinga","html_url":"https://github.com/thekalinga","followers_url":"https://api.github.com/users/thekalinga/followers","following_url":"https://api.github.com/users/thekalinga/following{/other_user}","gists_url":"https://api.github.com/users/thekalinga/gists{/gist_id}","starred_url":"https://api.github.com/users/thekalinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekalinga/subscriptions","organizations_url":"https://api.github.com/users/thekalinga/orgs","repos_url":"https://api.github.com/users/thekalinga/repos","events_url":"https://api.github.com/users/thekalinga/events{/privacy}","received_events_url":"https://api.github.com/users/thekalinga/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T10:26:56Z","updated_at":"2018-08-20T10:26:56Z","author_association":"NONE","body":"In which case, the subscriber must have a way to determine this, which will contradict \"If you can't tell, then that's fine.\""}}
{"actor":{"display_login":"thekalinga"}}