GitHub PullRequestReviewCommentEvent at 2014-12-30 21:38:16
Repository: reactive-streams
Actor: viktorklang
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/22365959","id":22365959,"diff_hunk":"@@ -0,0 +1,67 @@\n+package org.reactivestreams.tck;\n+\n+import org.reactivestreams.Publisher;\n+import org.reactivestreams.tck.support.Function;\n+import org.reactivestreams.tck.support.HelperPublisher;\n+import org.reactivestreams.tck.support.InfiniteHelperPublisher;\n+\n+import java.util.concurrent.ExecutorService;\n+\n+/**\n+ * Type which is able to create elements based on a seed {@code id} value.\n+ * <p>\n+ * Simplest implementations will simply return the incoming id as the element.\n+ *\n+ * @param <T> type of element to be delivered to the Subscriber\n+ */\n+public abstract class WithHelperPublisher<T> {\n+\n+  /** ExecutorService to be used by the provided helper {@link org.reactivestreams.Publisher} */\n+  public abstract ExecutorService publisherExecutorService();\n+\n+  /**\n+   * Implement this method to match your expected element type.\n+   * In case of implementing a simple Subscriber which is able to consume any kind of element simply return the\n+   * incoming {@code element} element.\n+   * <p/>\n+   * Sometimes the Subscriber may be limited in what type of element it is able to consume, this you may have to implement\n+   * this method such that the emitted element matches the Subscribers requirements. Simplest implementations would be\n+   * to simply pass in the {@code element} as payload of your custom element, such as appending it to a String or other identifier.\n+   *\n+   * @return element of the matching type {@code T} that will be delivered to the tested Subscriber\n+   */\n+  public abstract T createElement(int element);","path":"tck/src/main/java/org/reactivestreams/tck/WithHelperPublisher.java","position":33,"original_position":33,"commit_id":"4c5361d44be2d9d6307fb0e919e2d59dac3df296","original_commit_id":"4c5361d44be2d9d6307fb0e919e2d59dac3df296","user":{"login":"viktorklang","id":10871,"avatar_url":"https://avatars.githubusercontent.com/u/10871?v=3","gravatar_id":"","url":"https://api.github.com/users/viktorklang","html_url":"https://github.com/viktorklang","followers_url":"https://api.github.com/users/viktorklang/followers","following_url":"https://api.github.com/users/viktorklang/following{/other_user}","gists_url":"https://api.github.com/users/viktorklang/gists{/gist_id}","starred_url":"https://api.github.com/users/viktorklang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktorklang/subscriptions","organizations_url":"https://api.github.com/users/viktorklang/orgs","repos_url":"https://api.github.com/users/viktorklang/repos","events_url":"https://api.github.com/users/viktorklang/events{/privacy}","received_events_url":"https://api.github.com/users/viktorklang/received_events","type":"User","site_admin":false},"body":"Since this method will be called by multiple threads, perhaps it is better to have it be like this:\r\n\r\n~~~java\r\npublic abstract Function<Integer, T> newElementCreator();\r\n~~~\r\n\r\nAnd document that the Function will be invoke from another thread.","created_at":"2014-12-30T21:38:16Z","updated_at":"2014-12-30T21:38:16Z","html_url":"https://github.com/reactive-streams/reactive-streams/pull/186#discussion_r22365959","pull_request_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/22365959"},"html":{"href":"https://github.com/reactive-streams/reactive-streams/pull/186#discussion_r22365959"},"pull_request":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186","id":26560280,"html_url":"https://github.com/reactive-streams/reactive-streams/pull/186","diff_url":"https://github.com/reactive-streams/reactive-streams/pull/186.diff","patch_url":"https://github.com/reactive-streams/reactive-streams/pull/186.patch","issue_url":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/186","number":186,"state":"open","locked":false,"title":"+tck #181 provides default helperPublisher for subscriber tests","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"This is a rather heavy PR, however it removes the need of implementing a (helper) Publisher when I'm only interested in implementing a Subscriber. This is done by providing a default implementation - based on the example implementations (reused).\r\n\r\nThe TCK automatically picks the default publisher if it is able to. If not (types don't match), it fails ASAP and tells the implementer that he/she has to implement a custom publisher (like we, until now, always forced implementers to).\r\n\r\nLet me know what you think!\r\n\r\n```\r\n+ When subscriber verifications are extended using Integer\r\n  we can use the existing publisher implementations from examples\r\n  to drive the tests. This allows implementers who only care about\r\n  implementing Subscribers to not care at all about implementing\r\n  Publishers\r\n+ In case the subscriber verification is extended using a custom signal\r\n  type (defined as \"not Integer\") we do not magically generate a\r\n  Publisher of this type, but instead fail the tests telling the\r\n  implementer that he/she will need to implement a custom helperPublisher\r\n  which is exactly what we have up until now always demanded from\r\n  implementations.\r\n+ We also provide tests to verify the test failures work as expected,\r\n  and that the messages are indeed helpful.\r\n+ Updated TCK README.md to clarify when to implement a custom publisher\r\n+ fixed mistakenly added `<T>` on NumberPublisher - it is bound to Ints\r\n+ TCK now depends on examples, as it uses the well documented async\r\n  publisher to provide the default publisher for numbers. As well as\r\n  in order to allow implementers to reuse those publishers when\r\n  implementing custom Publishers to drive their Subscriber specs.\r\n```\r\n\r\nRefs #181\r\nMerry :christmas_tree: ;-)","created_at":"2014-12-24T14:24:52Z","updated_at":"2014-12-30T21:38:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6b6253b993981ae584f55dfbdc12a80bed36f92","assignee":null,"milestone":{"url":"https://api.github.com/repos/reactive-streams/reactive-streams/milestones/6","labels_url":"https://api.github.com/repos/reactive-streams/reactive-streams/milestones/6/labels","id":916278,"number":6,"title":"1.0.0.RC2","description":"","creator":{"login":"viktorklang","id":10871,"avatar_url":"https://avatars.githubusercontent.com/u/10871?v=3","gravatar_id":"","url":"https://api.github.com/users/viktorklang","html_url":"https://github.com/viktorklang","followers_url":"https://api.github.com/users/viktorklang/followers","following_url":"https://api.github.com/users/viktorklang/following{/other_user}","gists_url":"https://api.github.com/users/viktorklang/gists{/gist_id}","starred_url":"https://api.github.com/users/viktorklang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktorklang/subscriptions","organizations_url":"https://api.github.com/users/viktorklang/orgs","repos_url":"https://api.github.com/users/viktorklang/repos","events_url":"https://api.github.com/users/viktorklang/events{/privacy}","received_events_url":"https://api.github.com/users/viktorklang/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2014-12-28T22:04:04Z","updated_at":"2014-12-30T20:19:26Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186/commits","review_comments_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186/comments","review_comment_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/{number}","comments_url":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/186/comments","statuses_url":"https://api.github.com/repos/reactive-streams/reactive-streams/statuses/4c5361d44be2d9d6307fb0e919e2d59dac3df296","head":{"label":"ktoso:provide-publisher-ktoso","ref":"provide-publisher-ktoso","sha":"4c5361d44be2d9d6307fb0e919e2d59dac3df296","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"repo":{"id":18751443,"name":"reactive-streams","full_name":"ktoso/reactive-streams","owner":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ktoso/reactive-streams","description":"","fork":true,"url":"https://api.github.com/repos/ktoso/reactive-streams","forks_url":"https://api.github.com/repos/ktoso/reactive-streams/forks","keys_url":"https://api.github.com/repos/ktoso/reactive-streams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktoso/reactive-streams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktoso/reactive-streams/teams","hooks_url":"https://api.github.com/repos/ktoso/reactive-streams/hooks","issue_events_url":"https://api.github.com/repos/ktoso/reactive-streams/issues/events{/number}","events_url":"https://api.github.com/repos/ktoso/reactive-streams/events","assignees_url":"https://api.github.com/repos/ktoso/reactive-streams/assignees{/user}","branches_url":"https://api.github.com/repos/ktoso/reactive-streams/branches{/branch}","tags_url":"https://api.github.com/repos/ktoso/reactive-streams/tags","blobs_url":"https://api.github.com/repos/ktoso/reactive-streams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktoso/reactive-streams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktoso/reactive-streams/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktoso/reactive-streams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktoso/reactive-streams/statuses/{sha}","languages_url":"https://api.github.com/repos/ktoso/reactive-streams/languages","stargazers_url":"https://api.github.com/repos/ktoso/reactive-streams/stargazers","contributors_url":"https://api.github.com/repos/ktoso/reactive-streams/contributors","subscribers_url":"https://api.github.com/repos/ktoso/reactive-streams/subscribers","subscription_url":"https://api.github.com/repos/ktoso/reactive-streams/subscription","commits_url":"https://api.github.com/repos/ktoso/reactive-streams/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktoso/reactive-streams/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktoso/reactive-streams/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktoso/reactive-streams/issues/comments/{number}","contents_url":"https://api.github.com/repos/ktoso/reactive-streams/contents/{+path}","compare_url":"https://api.github.com/repos/ktoso/reactive-streams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktoso/reactive-streams/merges","archive_url":"https://api.github.com/repos/ktoso/reactive-streams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktoso/reactive-streams/downloads","issues_url":"https://api.github.com/repos/ktoso/reactive-streams/issues{/number}","pulls_url":"https://api.github.com/repos/ktoso/reactive-streams/pulls{/number}","milestones_url":"https://api.github.com/repos/ktoso/reactive-streams/milestones{/number}","notifications_url":"https://api.github.com/repos/ktoso/reactive-streams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktoso/reactive-streams/labels{/name}","releases_url":"https://api.github.com/repos/ktoso/reactive-streams/releases{/id}","created_at":"2014-04-14T07:02:32Z","updated_at":"2014-12-10T09:27:57Z","pushed_at":"2014-12-30T16:13:17Z","git_url":"git://github.com/ktoso/reactive-streams.git","ssh_url":"git@github.com:ktoso/reactive-streams.git","clone_url":"https://github.com/ktoso/reactive-streams.git","svn_url":"https://github.com/ktoso/reactive-streams","homepage":"reactive-streams.org","size":1631,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"reactive-streams:master","ref":"master","sha":"b73ff9bbd9476316aaad71f5bd9ffef4a6b6fbc5","user":{"login":"reactive-streams","id":7080130,"avatar_url":"https://avatars.githubusercontent.com/u/7080130?v=3","gravatar_id":"","url":"https://api.github.com/users/reactive-streams","html_url":"https://github.com/reactive-streams","followers_url":"https://api.github.com/users/reactive-streams/followers","following_url":"https://api.github.com/users/reactive-streams/following{/other_user}","gists_url":"https://api.github.com/users/reactive-streams/gists{/gist_id}","starred_url":"https://api.github.com/users/reactive-streams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactive-streams/subscriptions","organizations_url":"https://api.github.com/users/reactive-streams/orgs","repos_url":"https://api.github.com/users/reactive-streams/repos","events_url":"https://api.github.com/users/reactive-streams/events{/privacy}","received_events_url":"https://api.github.com/users/reactive-streams/received_events","type":"Organization","site_admin":false},"repo":{"id":17286587,"name":"reactive-streams","full_name":"reactive-streams/reactive-streams","owner":{"login":"reactive-streams","id":7080130,"avatar_url":"https://avatars.githubusercontent.com/u/7080130?v=3","gravatar_id":"","url":"https://api.github.com/users/reactive-streams","html_url":"https://github.com/reactive-streams","followers_url":"https://api.github.com/users/reactive-streams/followers","following_url":"https://api.github.com/users/reactive-streams/following{/other_user}","gists_url":"https://api.github.com/users/reactive-streams/gists{/gist_id}","starred_url":"https://api.github.com/users/reactive-streams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactive-streams/subscriptions","organizations_url":"https://api.github.com/users/reactive-streams/orgs","repos_url":"https://api.github.com/users/reactive-streams/repos","events_url":"https://api.github.com/users/reactive-streams/events{/privacy}","received_events_url":"https://api.github.com/users/reactive-streams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reactive-streams/reactive-streams","description":"Reactive Streams Specification for the JVM","fork":false,"url":"https://api.github.com/repos/reactive-streams/reactive-streams","forks_url":"https://api.github.com/repos/reactive-streams/reactive-streams/forks","keys_url":"https://api.github.com/repos/reactive-streams/reactive-streams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactive-streams/reactive-streams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactive-streams/reactive-streams/teams","hooks_url":"https://api.github.com/repos/reactive-streams/reactive-streams/hooks","issue_events_url":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/events{/number}","events_url":"https://api.github.com/repos/reactive-streams/reactive-streams/events","assignees_url":"https://api.github.com/repos/reactive-streams/reactive-streams/assignees{/user}","branches_url":"https://api.github.com/repos/reactive-streams/reactive-streams/branches{/branch}","tags_url":"https://api.github.com/repos/reactive-streams/reactive-streams/tags","blobs_url":"https://api.github.com/repos/reactive-streams/reactive-streams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactive-streams/reactive-streams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactive-streams/reactive-streams/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactive-streams/reactive-streams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactive-streams/reactive-streams/statuses/{sha}","languages_url":"https://api.github.com/repos/reactive-streams/reactive-streams/languages","stargazers_url":"https://api.github.com/repos/reactive-streams/reactive-streams/stargazers","contributors_url":"https://api.github.com/repos/reactive-streams/reactive-streams/contributors","subscribers_url":"https://api.github.com/repos/reactive-streams/reactive-streams/subscribers","subscription_url":"https://api.github.com/repos/reactive-streams/reactive-streams/subscription","commits_url":"https://api.github.com/repos/reactive-streams/reactive-streams/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactive-streams/reactive-streams/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactive-streams/reactive-streams/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/comments/{number}","contents_url":"https://api.github.com/repos/reactive-streams/reactive-streams/contents/{+path}","compare_url":"https://api.github.com/repos/reactive-streams/reactive-streams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactive-streams/reactive-streams/merges","archive_url":"https://api.github.com/repos/reactive-streams/reactive-streams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactive-streams/reactive-streams/downloads","issues_url":"https://api.github.com/repos/reactive-streams/reactive-streams/issues{/number}","pulls_url":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls{/number}","milestones_url":"https://api.github.com/repos/reactive-streams/reactive-streams/milestones{/number}","notifications_url":"https://api.github.com/repos/reactive-streams/reactive-streams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactive-streams/reactive-streams/labels{/name}","releases_url":"https://api.github.com/repos/reactive-streams/reactive-streams/releases{/id}","created_at":"2014-02-28T13:16:15Z","updated_at":"2014-12-29T21:53:38Z","pushed_at":"2014-12-29T21:58:16Z","git_url":"git://github.com/reactive-streams/reactive-streams.git","ssh_url":"git@github.com:reactive-streams/reactive-streams.git","clone_url":"https://github.com/reactive-streams/reactive-streams.git","svn_url":"https://github.com/reactive-streams/reactive-streams","homepage":"http://www.reactive-streams.org/","size":2294,"stargazers_count":461,"watchers_count":461,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":14,"forks":37,"open_issues":14,"watchers":461,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186"},"html":{"href":"https://github.com/reactive-streams/reactive-streams/pull/186"},"issue":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/186"},"comments":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/reactive-streams/reactive-streams/statuses/4c5361d44be2d9d6307fb0e919e2d59dac3df296"}}}}