{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka-http/pulls/comments/195672042","pull_request_review_id":129088067,"id":195672042,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTY3MjA0Mg==","diff_hunk":"@@ -321,6 +322,35 @@ void discardEntityManuallyCloseConnections() {\n       );\n         //#discard-close-connections\n       }\n-    \n-  \n+\n+  public static void gracefulTerminationExample() throws Exception {\n+    //#graceful-termination\n+    ActorSystem system = ActorSystem.create();\n+    Materializer materializer = ActorMaterializer.create(system);\n+\n+\n+    CompletionStage<ServerBinding> binding = Http.get(system).bindAndHandle(\n+        Directives.complete(\"Hello world!\").flow(system, materializer),\n+        ConnectHttp.toHost(\"localhost\", 8080), materializer);\n+\n+    ServerBinding serverBinding = binding.toCompletableFuture().get(3, TimeUnit.SECONDS);\n+\n+    // ...\n+    // once ready to terminate the server, invoke terminate:\n+    CompletionStage<HttpTerminated> onceAllConnectionsTerminated =\n+        serverBinding.terminate(Duration.ofSeconds(3));\n+\n+    // once all connections are terminated,\n+    HttpTerminated httpTerminated = onceAllConnectionsTerminated.toCompletableFuture().get();","path":"docs/src/test/java/docs/http/javadsl/server/HttpServerExampleDocTest.java","position":116,"original_position":116,"commit_id":"8c0b79195a0d1a7911c75c9540ff8bd0dece5591","original_commit_id":"8c0b79195a0d1a7911c75c9540ff8bd0dece5591","user":{"login":"ktoso","id":120979,"node_id":"MDQ6VXNlcjEyMDk3OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/120979?v=4","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":"On purpose did not do callbacks since this is \"where you start the server\" where you often have a blocking read line or something anyway. But ok, can go back to callbacks","created_at":"2018-06-15T08:58:26Z","updated_at":"2018-06-15T08:58:27Z","html_url":"https://github.com/akka/akka-http/pull/2072#discussion_r195672042","pull_request_url":"https://api.github.com/repos/akka/akka-http/pulls/2072","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/akka/akka-http/pulls/comments/195672042"},"html":{"href":"https://github.com/akka/akka-http/pull/2072#discussion_r195672042"},"pull_request":{"href":"https://api.github.com/repos/akka/akka-http/pulls/2072"}},"in_reply_to_id":195670173},"pull_request":{"url":"https://api.github.com/repos/akka/akka-http/pulls/2072","id":194913127,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0OTEzMTI3","html_url":"https://github.com/akka/akka-http/pull/2072","diff_url":"https://github.com/akka/akka-http/pull/2072.diff","patch_url":"https://github.com/akka/akka-http/pull/2072.patch","issue_url":"https://api.github.com/repos/akka/akka-http/issues/2072","number":2072,"state":"closed","locked":false,"title":"+doc docs for graceful termination","user":{"login":"ktoso","id":120979,"node_id":"MDQ6VXNlcjEyMDk3OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/120979?v=4","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":"","created_at":"2018-06-14T14:29:12Z","updated_at":"2018-06-15T08:58:27Z","closed_at":"2018-06-15T08:41:26Z","merged_at":"2018-06-15T08:41:25Z","merge_commit_sha":"37169eb95a982195a439101e396c66c38caa400a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"raboof","id":131856,"node_id":"MDQ6VXNlcjEzMTg1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/131856?v=4","gravatar_id":"","url":"https://api.github.com/users/raboof","html_url":"https://github.com/raboof","followers_url":"https://api.github.com/users/raboof/followers","following_url":"https://api.github.com/users/raboof/following{/other_user}","gists_url":"https://api.github.com/users/raboof/gists{/gist_id}","starred_url":"https://api.github.com/users/raboof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raboof/subscriptions","organizations_url":"https://api.github.com/users/raboof/orgs","repos_url":"https://api.github.com/users/raboof/repos","events_url":"https://api.github.com/users/raboof/events{/privacy}","received_events_url":"https://api.github.com/users/raboof/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":427566720,"node_id":"MDU6TGFiZWw0Mjc1NjY3MjA=","url":"https://api.github.com/repos/akka/akka-http/labels/t:docs","name":"t:docs","color":"cccccc","default":false},{"id":436859583,"node_id":"MDU6TGFiZWw0MzY4NTk1ODM=","url":"https://api.github.com/repos/akka/akka-http/labels/tested","name":"tested","color":"d7e102","default":false}],"milestone":{"url":"https://api.github.com/repos/akka/akka-http/milestones/41","html_url":"https://github.com/akka/akka-http/milestone/41","labels_url":"https://api.github.com/repos/akka/akka-http/milestones/41/labels","id":3410859,"node_id":"MDk6TWlsZXN0b25lMzQxMDg1OQ==","number":41,"title":"10.1.3","description":"","creator":{"login":"raboof","id":131856,"node_id":"MDQ6VXNlcjEzMTg1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/131856?v=4","gravatar_id":"","url":"https://api.github.com/users/raboof","html_url":"https://github.com/raboof","followers_url":"https://api.github.com/users/raboof/followers","following_url":"https://api.github.com/users/raboof/following{/other_user}","gists_url":"https://api.github.com/users/raboof/gists{/gist_id}","starred_url":"https://api.github.com/users/raboof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raboof/subscriptions","organizations_url":"https://api.github.com/users/raboof/orgs","repos_url":"https://api.github.com/users/raboof/repos","events_url":"https://api.github.com/users/raboof/events{/privacy}","received_events_url":"https://api.github.com/users/raboof/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"open","created_at":"2018-06-08T12:53:10Z","updated_at":"2018-06-15T08:41:48Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/akka/akka-http/pulls/2072/commits","review_comments_url":"https://api.github.com/repos/akka/akka-http/pulls/2072/comments","review_comment_url":"https://api.github.com/repos/akka/akka-http/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/2072/comments","statuses_url":"https://api.github.com/repos/akka/akka-http/statuses/8c0b79195a0d1a7911c75c9540ff8bd0dece5591","head":{"label":"ktoso:wip-graceful-docs","ref":"wip-graceful-docs","sha":"8c0b79195a0d1a7911c75c9540ff8bd0dece5591","user":{"login":"ktoso","id":120979,"node_id":"MDQ6VXNlcjEyMDk3OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/120979?v=4","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":72620217,"node_id":"MDEwOlJlcG9zaXRvcnk3MjYyMDIxNw==","name":"akka-http","full_name":"ktoso/akka-http","owner":{"login":"ktoso","id":120979,"node_id":"MDQ6VXNlcjEyMDk3OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/120979?v=4","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/akka-http","description":"The Streaming-first HTTP server/module of Akka","fork":true,"url":"https://api.github.com/repos/ktoso/akka-http","forks_url":"https://api.github.com/repos/ktoso/akka-http/forks","keys_url":"https://api.github.com/repos/ktoso/akka-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktoso/akka-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktoso/akka-http/teams","hooks_url":"https://api.github.com/repos/ktoso/akka-http/hooks","issue_events_url":"https://api.github.com/repos/ktoso/akka-http/issues/events{/number}","events_url":"https://api.github.com/repos/ktoso/akka-http/events","assignees_url":"https://api.github.com/repos/ktoso/akka-http/assignees{/user}","branches_url":"https://api.github.com/repos/ktoso/akka-http/branches{/branch}","tags_url":"https://api.github.com/repos/ktoso/akka-http/tags","blobs_url":"https://api.github.com/repos/ktoso/akka-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktoso/akka-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktoso/akka-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktoso/akka-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktoso/akka-http/statuses/{sha}","languages_url":"https://api.github.com/repos/ktoso/akka-http/languages","stargazers_url":"https://api.github.com/repos/ktoso/akka-http/stargazers","contributors_url":"https://api.github.com/repos/ktoso/akka-http/contributors","subscribers_url":"https://api.github.com/repos/ktoso/akka-http/subscribers","subscription_url":"https://api.github.com/repos/ktoso/akka-http/subscription","commits_url":"https://api.github.com/repos/ktoso/akka-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktoso/akka-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktoso/akka-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktoso/akka-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/ktoso/akka-http/contents/{+path}","compare_url":"https://api.github.com/repos/ktoso/akka-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktoso/akka-http/merges","archive_url":"https://api.github.com/repos/ktoso/akka-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktoso/akka-http/downloads","issues_url":"https://api.github.com/repos/ktoso/akka-http/issues{/number}","pulls_url":"https://api.github.com/repos/ktoso/akka-http/pulls{/number}","milestones_url":"https://api.github.com/repos/ktoso/akka-http/milestones{/number}","notifications_url":"https://api.github.com/repos/ktoso/akka-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktoso/akka-http/labels{/name}","releases_url":"https://api.github.com/repos/ktoso/akka-http/releases{/id}","deployments_url":"https://api.github.com/repos/ktoso/akka-http/deployments","created_at":"2016-11-02T08:39:41Z","updated_at":"2018-04-09T16:42:50Z","pushed_at":"2018-06-15T08:55:15Z","git_url":"git://github.com/ktoso/akka-http.git","ssh_url":"git@github.com:ktoso/akka-http.git","clone_url":"https://github.com/ktoso/akka-http.git","svn_url":"https://github.com/ktoso/akka-http","homepage":"http://akka.io","size":19695,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"akka:master","ref":"master","sha":"04ece9f03f892459f40284fcd6aa3dab28ce7ebf","user":{"login":"akka","id":1496237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTYyMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/1496237?v=4","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":66077955,"node_id":"MDEwOlJlcG9zaXRvcnk2NjA3Nzk1NQ==","name":"akka-http","full_name":"akka/akka-http","owner":{"login":"akka","id":1496237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTYyMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/1496237?v=4","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka-http","description":"The Streaming-first HTTP server/module of Akka","fork":false,"url":"https://api.github.com/repos/akka/akka-http","forks_url":"https://api.github.com/repos/akka/akka-http/forks","keys_url":"https://api.github.com/repos/akka/akka-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka-http/teams","hooks_url":"https://api.github.com/repos/akka/akka-http/hooks","issue_events_url":"https://api.github.com/repos/akka/akka-http/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka-http/events","assignees_url":"https://api.github.com/repos/akka/akka-http/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka-http/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka-http/tags","blobs_url":"https://api.github.com/repos/akka/akka-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka-http/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka-http/languages","stargazers_url":"https://api.github.com/repos/akka/akka-http/stargazers","contributors_url":"https://api.github.com/repos/akka/akka-http/contributors","subscribers_url":"https://api.github.com/repos/akka/akka-http/subscribers","subscription_url":"https://api.github.com/repos/akka/akka-http/subscription","commits_url":"https://api.github.com/repos/akka/akka-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka-http/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka-http/merges","archive_url":"https://api.github.com/repos/akka/akka-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka-http/downloads","issues_url":"https://api.github.com/repos/akka/akka-http/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka-http/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka-http/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka-http/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka-http/releases{/id}","deployments_url":"https://api.github.com/repos/akka/akka-http/deployments","created_at":"2016-08-19T11:33:36Z","updated_at":"2018-06-15T08:41:31Z","pushed_at":"2018-06-15T08:41:26Z","git_url":"git://github.com/akka/akka-http.git","ssh_url":"git@github.com:akka/akka-http.git","clone_url":"https://github.com/akka/akka-http.git","svn_url":"https://github.com/akka/akka-http","homepage":"http://akka.io","size":10198,"stargazers_count":691,"watchers_count":691,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":323,"mirror_url":null,"archived":false,"open_issues_count":457,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":323,"open_issues":457,"watchers":691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka-http/pulls/2072"},"html":{"href":"https://github.com/akka/akka-http/pull/2072"},"issue":{"href":"https://api.github.com/repos/akka/akka-http/issues/2072"},"comments":{"href":"https://api.github.com/repos/akka/akka-http/issues/2072/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka-http/pulls/2072/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka-http/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka-http/pulls/2072/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka-http/statuses/8c0b79195a0d1a7911c75c9540ff8bd0dece5591"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ktoso"}}