{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc-java/pulls/comments/28520936","id":28520936,"diff_hunk":"@@ -48,4 +49,9 @@\n    */\n   ServerStreamListener streamCreated(ServerStream stream, String method,\n       Metadata.Headers headers);\n+\n+  /**\n+   * The transport completed shutting down. All resources have been released.\n+   */\n+  void transportTerminated();","path":"core/src/main/java/io/grpc/transport/ServerTransportListener.java","position":18,"original_position":18,"commit_id":"0b0bd0cb147699ee2b3ebcd19503a45dcad28837","original_commit_id":"762401cf68e52f235c184bb8cfd8c231da069dbe","user":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"body":"So I have two main problems with a single state as an API:\r\n\r\n1. It doesn't answer the question users will be asking. This means instead of doing ```if (isShutdown())``` like you do now, you have to do ```State state = state(); if (state == SHUTTING_DOWN || state == TERMINATED)```. Note that if we had a FAILED case, like Guava's Service, you would have to include it as well. This is annoying.\r\n\r\n2. You can't add new states in the future, because of point 1. That means you either error on the side of making too many states (making point 1 worse) or you error on the side of too few and now you have the same problem we have now. This is quite worrisome.\r\n\r\nSo the API is annoying to use and non-extensible. That seems to be the opposite of a \"good API\".\r\n\r\nThe benefit of a state() API is that it has a single method and that method gets you the state atomically. Having one method instead of two isn't very much of a savings. And we don't actually need the _states_. Other APIs do need to expose concrete states, but ours doesn't, so this possible benefit doesn't apply to us. (And generally such APIs don't suffer from point 1 above, so point 2 is also not an issue.)","created_at":"2015-04-16T15:38:16Z","updated_at":"2015-04-16T15:38:16Z","html_url":"https://github.com/grpc/grpc-java/pull/303#discussion_r28520936","pull_request_url":"https://api.github.com/repos/grpc/grpc-java/pulls/303","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/comments/28520936"},"html":{"href":"https://github.com/grpc/grpc-java/pull/303#discussion_r28520936"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/303"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-java/pulls/303","id":33281679,"html_url":"https://github.com/grpc/grpc-java/pull/303","diff_url":"https://github.com/grpc/grpc-java/pull/303.diff","patch_url":"https://github.com/grpc/grpc-java/pull/303.patch","issue_url":"https://api.github.com/repos/grpc/grpc-java/issues/303","number":303,"state":"open","locked":false,"title":"Remove Guava's Service from server transport","user":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"body":"ServerImpl.start() now throws IOException to make the error explicit.\r\nThis was previously being papered over by wrapping the exception in\r\nRuntimeException.\r\n\r\nResolves #35.","created_at":"2015-04-14T17:43:48Z","updated_at":"2015-04-16T15:38:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11fd75c4697bc206bfaa6c65a0543b08f9cf7020","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc-java/pulls/303/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc-java/pulls/303/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/303/comments","statuses_url":"https://api.github.com/repos/grpc/grpc-java/statuses/0b0bd0cb147699ee2b3ebcd19503a45dcad28837","head":{"label":"ejona86:remove-service-from-server","ref":"remove-service-from-server","sha":"0b0bd0cb147699ee2b3ebcd19503a45dcad28837","user":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"repo":{"id":31378968,"name":"grpc-java","full_name":"ejona86/grpc-java","owner":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejona86/grpc-java","description":"The Java gRPC implementation. HTTP/2 based RPC","fork":true,"url":"https://api.github.com/repos/ejona86/grpc-java","forks_url":"https://api.github.com/repos/ejona86/grpc-java/forks","keys_url":"https://api.github.com/repos/ejona86/grpc-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejona86/grpc-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejona86/grpc-java/teams","hooks_url":"https://api.github.com/repos/ejona86/grpc-java/hooks","issue_events_url":"https://api.github.com/repos/ejona86/grpc-java/issues/events{/number}","events_url":"https://api.github.com/repos/ejona86/grpc-java/events","assignees_url":"https://api.github.com/repos/ejona86/grpc-java/assignees{/user}","branches_url":"https://api.github.com/repos/ejona86/grpc-java/branches{/branch}","tags_url":"https://api.github.com/repos/ejona86/grpc-java/tags","blobs_url":"https://api.github.com/repos/ejona86/grpc-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejona86/grpc-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejona86/grpc-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejona86/grpc-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejona86/grpc-java/statuses/{sha}","languages_url":"https://api.github.com/repos/ejona86/grpc-java/languages","stargazers_url":"https://api.github.com/repos/ejona86/grpc-java/stargazers","contributors_url":"https://api.github.com/repos/ejona86/grpc-java/contributors","subscribers_url":"https://api.github.com/repos/ejona86/grpc-java/subscribers","subscription_url":"https://api.github.com/repos/ejona86/grpc-java/subscription","commits_url":"https://api.github.com/repos/ejona86/grpc-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejona86/grpc-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejona86/grpc-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejona86/grpc-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/ejona86/grpc-java/contents/{+path}","compare_url":"https://api.github.com/repos/ejona86/grpc-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejona86/grpc-java/merges","archive_url":"https://api.github.com/repos/ejona86/grpc-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejona86/grpc-java/downloads","issues_url":"https://api.github.com/repos/ejona86/grpc-java/issues{/number}","pulls_url":"https://api.github.com/repos/ejona86/grpc-java/pulls{/number}","milestones_url":"https://api.github.com/repos/ejona86/grpc-java/milestones{/number}","notifications_url":"https://api.github.com/repos/ejona86/grpc-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejona86/grpc-java/labels{/name}","releases_url":"https://api.github.com/repos/ejona86/grpc-java/releases{/id}","created_at":"2015-02-26T17:23:03Z","updated_at":"2015-04-15T16:43:21Z","pushed_at":"2015-04-16T15:00:47Z","git_url":"git://github.com/ejona86/grpc-java.git","ssh_url":"git@github.com:ejona86/grpc-java.git","clone_url":"https://github.com/ejona86/grpc-java.git","svn_url":"https://github.com/ejona86/grpc-java","homepage":"","size":2231,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"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":"grpc:master","ref":"master","sha":"5b2e336b6f4a5acd2ce6694c87f762d0a9fc7a17","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729926,"name":"grpc-java","full_name":"grpc/grpc-java","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc-java","description":"The Java gRPC implementation. HTTP/2 based RPC","fork":false,"url":"https://api.github.com/repos/grpc/grpc-java","forks_url":"https://api.github.com/repos/grpc/grpc-java/forks","keys_url":"https://api.github.com/repos/grpc/grpc-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc-java/teams","hooks_url":"https://api.github.com/repos/grpc/grpc-java/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc-java/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc-java/events","assignees_url":"https://api.github.com/repos/grpc/grpc-java/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc-java/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc-java/tags","blobs_url":"https://api.github.com/repos/grpc/grpc-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc-java/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc-java/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc-java/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc-java/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc-java/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc-java/subscription","commits_url":"https://api.github.com/repos/grpc/grpc-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc-java/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc-java/merges","archive_url":"https://api.github.com/repos/grpc/grpc-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc-java/downloads","issues_url":"https://api.github.com/repos/grpc/grpc-java/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc-java/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc-java/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc-java/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc-java/releases{/id}","created_at":"2014-12-08T19:00:00Z","updated_at":"2015-04-16T01:34:30Z","pushed_at":"2015-04-16T15:35:00Z","git_url":"git://github.com/grpc/grpc-java.git","ssh_url":"git@github.com:grpc/grpc-java.git","clone_url":"https://github.com/grpc/grpc-java.git","svn_url":"https://github.com/grpc/grpc-java","homepage":"","size":17097,"stargazers_count":655,"watchers_count":655,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":55,"forks":134,"open_issues":55,"watchers":655,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/303"},"html":{"href":"https://github.com/grpc/grpc-java/pull/303"},"issue":{"href":"https://api.github.com/repos/grpc/grpc-java/issues/303"},"comments":{"href":"https://api.github.com/repos/grpc/grpc-java/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc-java/statuses/0b0bd0cb147699ee2b3ebcd19503a45dcad28837"}}}}