{"action":"created","comment":{"url":"https://api.github.com/repos/square/okhttp/pulls/comments/65718444","id":65718444,"diff_hunk":"@@ -213,6 +215,38 @@\n     assertFalse(a4.isCanceled());\n   }\n \n+  @Test public void idleCallbackInvokedWhenIdle() throws InterruptedException {\n+    final AtomicBoolean idle = new AtomicBoolean();\n+    dispatcher.setIdleCallback(new Runnable() {\n+      @Override public void run() {\n+        idle.set(true);\n+      }\n+    });\n+\n+    client.newCall(newRequest(\"http://a/1\")).enqueue(callback);\n+    client.newCall(newRequest(\"http://a/2\")).enqueue(callback);\n+    executor.finishJob(\"http://a/1\");\n+    assertFalse(idle.get());\n+\n+    final CountDownLatch ready = new CountDownLatch(1);\n+    client = client.newBuilder()\n+        .addInterceptor(new Interceptor() {\n+          @Override public Response intercept(Chain chain) throws IOException {\n+            ready.countDown();\n+            return chain.proceed(chain.request());\n+          }\n+        })\n+        .build();\n+\n+    Thread t1 = makeSynchronousCall(client.newCall(newRequest(\"http://a/3\")));\n+    ready.await(5, SECONDS);\n+    executor.finishJob(\"http://a/2\");\n+    assertFalse(idle.get());","path":"okhttp-tests/src/test/java/okhttp3/DispatcherTest.java","position":43,"original_position":43,"commit_id":"38e4047430512d26231fa97b6eca5eb616f94253","original_commit_id":"38e4047430512d26231fa97b6eca5eb616f94253","user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"body":"Is this line racy? Not sure how we prevent the 3rd request from completing earlier","created_at":"2016-06-03T14:41:40Z","updated_at":"2016-06-03T14:41:40Z","html_url":"https://github.com/square/okhttp/pull/2601#discussion_r65718444","pull_request_url":"https://api.github.com/repos/square/okhttp/pulls/2601","_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments/65718444"},"html":{"href":"https://github.com/square/okhttp/pull/2601#discussion_r65718444"},"pull_request":{"href":"https://api.github.com/repos/square/okhttp/pulls/2601"}}},"pull_request":{"url":"https://api.github.com/repos/square/okhttp/pulls/2601","id":72406770,"html_url":"https://github.com/square/okhttp/pull/2601","diff_url":"https://github.com/square/okhttp/pull/2601.diff","patch_url":"https://github.com/square/okhttp/pull/2601.patch","issue_url":"https://api.github.com/repos/square/okhttp/issues/2601","number":2601,"state":"open","locked":false,"title":"Add support for an idle callback to Dispatcher.","user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","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":"Closes #2600.","created_at":"2016-06-02T19:52:21Z","updated_at":"2016-06-03T14:41:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4971135ef0e972c1b45296861563c9d558549564","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/okhttp/pulls/2601/commits","review_comments_url":"https://api.github.com/repos/square/okhttp/pulls/2601/comments","review_comment_url":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/okhttp/issues/2601/comments","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/38e4047430512d26231fa97b6eca5eb616f94253","head":{"label":"square:jw/idle","ref":"jw/idle","sha":"38e4047430512d26231fa97b6eca5eb616f94253","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+HTTP/2 client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","deployments_url":"https://api.github.com/repos/square/okhttp/deployments","created_at":"2012-07-23T13:42:55Z","updated_at":"2016-06-03T13:52:12Z","pushed_at":"2016-06-03T04:20:47Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":18292,"stargazers_count":11754,"watchers_count":11754,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3063,"mirror_url":null,"open_issues_count":110,"forks":3063,"open_issues":110,"watchers":11754,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"25491a9066ae41d49f541061d54366c3ee5a606b","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+HTTP/2 client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","deployments_url":"https://api.github.com/repos/square/okhttp/deployments","created_at":"2012-07-23T13:42:55Z","updated_at":"2016-06-03T13:52:12Z","pushed_at":"2016-06-03T04:20:47Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":18292,"stargazers_count":11754,"watchers_count":11754,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3063,"mirror_url":null,"open_issues_count":110,"forks":3063,"open_issues":110,"watchers":11754,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/2601"},"html":{"href":"https://github.com/square/okhttp/pull/2601"},"issue":{"href":"https://api.github.com/repos/square/okhttp/issues/2601"},"comments":{"href":"https://api.github.com/repos/square/okhttp/issues/2601/comments"},"review_comments":{"href":"https://api.github.com/repos/square/okhttp/pulls/2601/comments"},"review_comment":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/okhttp/pulls/2601/commits"},"statuses":{"href":"https://api.github.com/repos/square/okhttp/statuses/38e4047430512d26231fa97b6eca5eb616f94253"}}}}
{"actor":{"display_login":"swankjesse"}}