{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/comments/198843611","pull_request_review_id":132845470,"id":198843611,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODg0MzYxMQ==","diff_hunk":"@@ -47,6 +48,28 @@ public static Scheduler from(Looper looper) {\n         return new HandlerScheduler(new Handler(looper));\n     }\n \n+    @TargetApi(Build.VERSION_CODES.P)\n+    private static Handler createAsyncHandler(Looper looper) {\n+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n+            return Handler.createAsync(looper);\n+        } else {","path":"rxandroid/src/main/java/io/reactivex/android/schedulers/AndroidSchedulers.java","position":35,"original_position":35,"commit_id":"2e64d32b689a13cfc8f828aac10796a095c299ba","original_commit_id":"2e64d32b689a13cfc8f828aac10796a095c299ba","user":{"login":"JakeWharton","id":66577,"node_id":"MDQ6VXNlcjY2NTc3","avatar_url":"https://avatars0.githubusercontent.com/u/66577?v=4","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"body":"`else` not required after `return`","created_at":"2018-06-28T13:40:33Z","updated_at":"2018-06-28T13:43:01Z","html_url":"https://github.com/ReactiveX/RxAndroid/pull/416#discussion_r198843611","pull_request_url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/comments/198843611"},"html":{"href":"https://github.com/ReactiveX/RxAndroid/pull/416#discussion_r198843611"},"pull_request":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416","id":168592440,"node_id":"MDExOlB1bGxSZXF1ZXN0MTY4NTkyNDQw","html_url":"https://github.com/ReactiveX/RxAndroid/pull/416","diff_url":"https://github.com/ReactiveX/RxAndroid/pull/416.diff","patch_url":"https://github.com/ReactiveX/RxAndroid/pull/416.patch","issue_url":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/416","number":416,"state":"open","locked":false,"title":"Proposal/rehash: Use an async Handler","user":{"login":"hzsweers","id":1361086,"node_id":"MDQ6VXNlcjEzNjEwODY=","avatar_url":"https://avatars1.githubusercontent.com/u/1361086?v=4","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"body":"This PR changes the default main thread `Handler` to use asynchronous messaging. This allows us to avoid VSYNC locking that otherwise pushes every `post` to the next frame.\r\n\r\nThis works by relying on the new `Handler.createAsync` factory in API 28, and on pre-28 it will reflectively fall back to a private constructor of Handler (that's always existed) to enable this.\r\n\r\nThis should give us the original goal of #228 with the safety of still leaning on the main thread looper and not trying to directly run things ourselves and risking deadlocks/trampolining issues.\r\n\r\nTo use SDK 28, updated the AGP plugin and gradle along the way.\r\n\r\n*Prior discussion below*\r\n\r\n~This is a main thread scheduler that's optimized to directly execute given Runnables if it's already on the main thread, rather than always scheduling.~\r\n\r\n~Prior art: #228~\r\n\r\n~Kept as a standalone implementation right now for review and discussion, but ideally this implementation would replace the existing main thread scheduler implementation as the default.~","created_at":"2018-02-12T14:28:33Z","updated_at":"2018-06-28T13:43:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2df81db5dae08bdcb36de609edd4c1d8ca32a44","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416/commits","review_comments_url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416/comments","review_comment_url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/416/comments","statuses_url":"https://api.github.com/repos/ReactiveX/RxAndroid/statuses/2e64d32b689a13cfc8f828aac10796a095c299ba","head":{"label":"hzsweers:z/fastpath","ref":"z/fastpath","sha":"2e64d32b689a13cfc8f828aac10796a095c299ba","user":{"login":"hzsweers","id":1361086,"node_id":"MDQ6VXNlcjEzNjEwODY=","avatar_url":"https://avatars1.githubusercontent.com/u/1361086?v=4","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"repo":{"id":60322877,"node_id":"MDEwOlJlcG9zaXRvcnk2MDMyMjg3Nw==","name":"RxAndroid","full_name":"hzsweers/RxAndroid","owner":{"login":"hzsweers","id":1361086,"node_id":"MDQ6VXNlcjEzNjEwODY=","avatar_url":"https://avatars1.githubusercontent.com/u/1361086?v=4","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hzsweers/RxAndroid","description":"RxJava bindings for Android","fork":true,"url":"https://api.github.com/repos/hzsweers/RxAndroid","forks_url":"https://api.github.com/repos/hzsweers/RxAndroid/forks","keys_url":"https://api.github.com/repos/hzsweers/RxAndroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hzsweers/RxAndroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hzsweers/RxAndroid/teams","hooks_url":"https://api.github.com/repos/hzsweers/RxAndroid/hooks","issue_events_url":"https://api.github.com/repos/hzsweers/RxAndroid/issues/events{/number}","events_url":"https://api.github.com/repos/hzsweers/RxAndroid/events","assignees_url":"https://api.github.com/repos/hzsweers/RxAndroid/assignees{/user}","branches_url":"https://api.github.com/repos/hzsweers/RxAndroid/branches{/branch}","tags_url":"https://api.github.com/repos/hzsweers/RxAndroid/tags","blobs_url":"https://api.github.com/repos/hzsweers/RxAndroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hzsweers/RxAndroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hzsweers/RxAndroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/hzsweers/RxAndroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hzsweers/RxAndroid/statuses/{sha}","languages_url":"https://api.github.com/repos/hzsweers/RxAndroid/languages","stargazers_url":"https://api.github.com/repos/hzsweers/RxAndroid/stargazers","contributors_url":"https://api.github.com/repos/hzsweers/RxAndroid/contributors","subscribers_url":"https://api.github.com/repos/hzsweers/RxAndroid/subscribers","subscription_url":"https://api.github.com/repos/hzsweers/RxAndroid/subscription","commits_url":"https://api.github.com/repos/hzsweers/RxAndroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/hzsweers/RxAndroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/hzsweers/RxAndroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/hzsweers/RxAndroid/issues/comments{/number}","contents_url":"https://api.github.com/repos/hzsweers/RxAndroid/contents/{+path}","compare_url":"https://api.github.com/repos/hzsweers/RxAndroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hzsweers/RxAndroid/merges","archive_url":"https://api.github.com/repos/hzsweers/RxAndroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hzsweers/RxAndroid/downloads","issues_url":"https://api.github.com/repos/hzsweers/RxAndroid/issues{/number}","pulls_url":"https://api.github.com/repos/hzsweers/RxAndroid/pulls{/number}","milestones_url":"https://api.github.com/repos/hzsweers/RxAndroid/milestones{/number}","notifications_url":"https://api.github.com/repos/hzsweers/RxAndroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hzsweers/RxAndroid/labels{/name}","releases_url":"https://api.github.com/repos/hzsweers/RxAndroid/releases{/id}","deployments_url":"https://api.github.com/repos/hzsweers/RxAndroid/deployments","created_at":"2016-06-03T06:11:45Z","updated_at":"2016-06-03T06:11:46Z","pushed_at":"2018-06-26T19:55:14Z","git_url":"git://github.com/hzsweers/RxAndroid.git","ssh_url":"git@github.com:hzsweers/RxAndroid.git","clone_url":"https://github.com/hzsweers/RxAndroid.git","svn_url":"https://github.com/hzsweers/RxAndroid","homepage":"","size":805,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ReactiveX:2.x","ref":"2.x","sha":"3a425c0858a96cec076f81422c0d471672f1b03d","user":{"login":"ReactiveX","id":6407041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0MDcwNDE=","avatar_url":"https://avatars1.githubusercontent.com/u/6407041?v=4","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"repo":{"id":23095954,"node_id":"MDEwOlJlcG9zaXRvcnkyMzA5NTk1NA==","name":"RxAndroid","full_name":"ReactiveX/RxAndroid","owner":{"login":"ReactiveX","id":6407041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0MDcwNDE=","avatar_url":"https://avatars1.githubusercontent.com/u/6407041?v=4","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveX/RxAndroid","description":"RxJava bindings for Android","fork":false,"url":"https://api.github.com/repos/ReactiveX/RxAndroid","forks_url":"https://api.github.com/repos/ReactiveX/RxAndroid/forks","keys_url":"https://api.github.com/repos/ReactiveX/RxAndroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveX/RxAndroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveX/RxAndroid/teams","hooks_url":"https://api.github.com/repos/ReactiveX/RxAndroid/hooks","issue_events_url":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveX/RxAndroid/events","assignees_url":"https://api.github.com/repos/ReactiveX/RxAndroid/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveX/RxAndroid/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveX/RxAndroid/tags","blobs_url":"https://api.github.com/repos/ReactiveX/RxAndroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveX/RxAndroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveX/RxAndroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveX/RxAndroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveX/RxAndroid/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveX/RxAndroid/languages","stargazers_url":"https://api.github.com/repos/ReactiveX/RxAndroid/stargazers","contributors_url":"https://api.github.com/repos/ReactiveX/RxAndroid/contributors","subscribers_url":"https://api.github.com/repos/ReactiveX/RxAndroid/subscribers","subscription_url":"https://api.github.com/repos/ReactiveX/RxAndroid/subscription","commits_url":"https://api.github.com/repos/ReactiveX/RxAndroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveX/RxAndroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveX/RxAndroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveX/RxAndroid/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveX/RxAndroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveX/RxAndroid/merges","archive_url":"https://api.github.com/repos/ReactiveX/RxAndroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveX/RxAndroid/downloads","issues_url":"https://api.github.com/repos/ReactiveX/RxAndroid/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveX/RxAndroid/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveX/RxAndroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveX/RxAndroid/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveX/RxAndroid/releases{/id}","deployments_url":"https://api.github.com/repos/ReactiveX/RxAndroid/deployments","created_at":"2014-08-19T03:46:38Z","updated_at":"2018-06-28T10:03:17Z","pushed_at":"2018-06-26T19:55:16Z","git_url":"git://github.com/ReactiveX/RxAndroid.git","ssh_url":"git@github.com:ReactiveX/RxAndroid.git","clone_url":"https://github.com/ReactiveX/RxAndroid.git","svn_url":"https://github.com/ReactiveX/RxAndroid","homepage":"","size":801,"stargazers_count":16230,"watchers_count":16230,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2628,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2628,"open_issues":4,"watchers":16230,"default_branch":"2.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416"},"html":{"href":"https://github.com/ReactiveX/RxAndroid/pull/416"},"issue":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/416"},"comments":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/issues/416/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/pulls/416/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveX/RxAndroid/statuses/2e64d32b689a13cfc8f828aac10796a095c299ba"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"JakeWharton"}}