{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/34572112","id":34572112,"diff_hunk":"@@ -0,0 +1,61 @@\n+/*\n+ * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>\n+ */\n+package akka.http.javadsl.server.directives\n+\n+import akka.http.javadsl.server.Route\n+import akka.http.javadsl.server.RouteResult\n+import akka.http.javadsl.server.RequestVal\n+import akka.http.javadsl.server.RequestContext\n+import scala.annotation.varargs\n+import scala.concurrent.Future\n+\n+abstract class BasicDirectivesBase {\n+  /** INTERNAL API */\n+  private[http] def handle(extractions: RequestVal[_]*)(f: RequestContext ⇒ RouteResult): Route\n+\n+  /**\n+   * Handles the route using the given function.\n+   * The function MUST NOT return `null`.\n+   *\n+   * If the `handler` is accessing request values these must be passed to this method in order for extraction to be performed.\n+   */\n+  @varargs def handleWith(handler: akka.japi.function.Function[RequestContext, RouteResult], extractions: RequestVal[_]*): Route =\n+    handle(extractions: _*)(ctx => handler(ctx))\n+\n+  /**\n+   * Handles the route using the given function, completing the route once the returned [[scala.concurrent.Future]] completes.\n+   * The function MUST NOT return `null`.\n+   *\n+   * If the `handler` is accessing request values these must be passed to this method in order for extraction to be performed.\n+   */\n+  @varargs def handleWithAsync(handler: akka.japi.function.Function[RequestContext, Future[RouteResult]], extractions: RequestVal[_]*): Route =\n+    handle(extractions: _*)(ctx => ctx.completeWith(handler(ctx)))\n+\n+\n+  [1..21#/**\n+   * Handles the route using the given function. The function MUST NOT return `null`.\n+   *\n+   * For convenience, using Java 8 lambda expressions as the `handler` function is recommended.\n+   * For Java 6 or 7 users the convenience [[akka.http.javadsl.server.Handler1]] class (which itself extends\n+   * [[akka.japi.function.Function2]] should prove to be useful, as it matches naming-wise with the number of\n+   * handled request values.\n+   */\n+  def handleWith1[[#T1#]]([#v1: RequestVal[T1]#], handler: akka.japi.function.Function2[RequestContext, [#T1#], RouteResult]): Route =\n+    handle([#v1#])(ctx => handler(ctx, [#v1.get(ctx)#]))\n+\n+  /**\n+   * Handles the route using the given function, completing the route once the returned [[scala.concurrent.Future]] completes.\n+   * The function MUST NOT return `null`.\n+   *\n+   * For convenience, using Java 8 lambda expressions as the `handler` function is recommended.\n+   * For Java 6 or 7 users the convenience [[akka.http.javadsl.server.Handler1]] class (which itself extends\n+   * [[akka.japi.function.Function2]] should prove to be useful, as it matches naming-wise with the number of\n+   * handled request values.\n+   */\n+  def handleWithAsync1[[#T1#]]([#v1: RequestVal[T1]#], handler: akka.japi.function.Function2[RequestContext, [#T1#], Future[RouteResult]]): Route =","path":"akka-http/src/main/boilerplate/akka/http/javadsl/server/directives/BasicDirectivesBase.scala.template","position":56,"original_position":56,"commit_id":"91af328ebe17149132ac4661f05389e4dd57924d","original_commit_id":"91af328ebe17149132ac4661f05389e4dd57924d","user":{"login":"jrudolph","id":9868,"avatar_url":"https://avatars.githubusercontent.com/u/9868?v=3","gravatar_id":"","url":"https://api.github.com/users/jrudolph","html_url":"https://github.com/jrudolph","followers_url":"https://api.github.com/users/jrudolph/followers","following_url":"https://api.github.com/users/jrudolph/following{/other_user}","gists_url":"https://api.github.com/users/jrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/jrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrudolph/subscriptions","organizations_url":"https://api.github.com/users/jrudolph/orgs","repos_url":"https://api.github.com/users/jrudolph/repos","events_url":"https://api.github.com/users/jrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/jrudolph/received_events","type":"User","site_admin":false},"body":"Actually, you don't really need the async variant because there's `RequestContext.completeWith` which turns an async result into a (seemingly) sync one.","created_at":"2015-07-14T14:17:47Z","updated_at":"2015-07-14T14:17:47Z","html_url":"https://github.com/akka/akka/pull/17988#discussion_r34572112","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/17988","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/34572112"},"html":{"href":"https://github.com/akka/akka/pull/17988#discussion_r34572112"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/17988"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/17988","id":39916644,"html_url":"https://github.com/akka/akka/pull/17988","diff_url":"https://github.com/akka/akka/pull/17988.diff","patch_url":"https://github.com/akka/akka/pull/17988.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/17988","number":17988,"state":"open","locked":false,"title":"!htp #17965 more consistent and 22-ified javadsl handleWith","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":"Adjusts javadsl as we discussed in #17965\r\n\r\nPlease review @2m @jrudolph ","created_at":"2015-07-14T13:42:24Z","updated_at":"2015-07-14T14:17:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"251cb3afe421201b115d42dbd8b67b35edff281f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/17988/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/17988/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/17988/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/91af328ebe17149132ac4661f05389e4dd57924d","head":{"label":"ktoso:wip-javadsl-handleWith-ktoso","ref":"wip-javadsl-handleWith-ktoso","sha":"91af328ebe17149132ac4661f05389e4dd57924d","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":4462204,"name":"akka","full_name":"ktoso/akka","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/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/ktoso/akka","forks_url":"https://api.github.com/repos/ktoso/akka/forks","keys_url":"https://api.github.com/repos/ktoso/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktoso/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktoso/akka/teams","hooks_url":"https://api.github.com/repos/ktoso/akka/hooks","issue_events_url":"https://api.github.com/repos/ktoso/akka/issues/events{/number}","events_url":"https://api.github.com/repos/ktoso/akka/events","assignees_url":"https://api.github.com/repos/ktoso/akka/assignees{/user}","branches_url":"https://api.github.com/repos/ktoso/akka/branches{/branch}","tags_url":"https://api.github.com/repos/ktoso/akka/tags","blobs_url":"https://api.github.com/repos/ktoso/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktoso/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktoso/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktoso/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktoso/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/ktoso/akka/languages","stargazers_url":"https://api.github.com/repos/ktoso/akka/stargazers","contributors_url":"https://api.github.com/repos/ktoso/akka/contributors","subscribers_url":"https://api.github.com/repos/ktoso/akka/subscribers","subscription_url":"https://api.github.com/repos/ktoso/akka/subscription","commits_url":"https://api.github.com/repos/ktoso/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktoso/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktoso/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktoso/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ktoso/akka/contents/{+path}","compare_url":"https://api.github.com/repos/ktoso/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktoso/akka/merges","archive_url":"https://api.github.com/repos/ktoso/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktoso/akka/downloads","issues_url":"https://api.github.com/repos/ktoso/akka/issues{/number}","pulls_url":"https://api.github.com/repos/ktoso/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/ktoso/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/ktoso/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktoso/akka/labels{/name}","releases_url":"https://api.github.com/repos/ktoso/akka/releases{/id}","created_at":"2012-05-27T14:05:17Z","updated_at":"2015-04-03T11:58:56Z","pushed_at":"2015-07-14T13:58:06Z","git_url":"git://github.com/ktoso/akka.git","ssh_url":"git@github.com:ktoso/akka.git","clone_url":"https://github.com/ktoso/akka.git","svn_url":"https://github.com/ktoso/akka","homepage":"http://akka.io","size":168267,"stargazers_count":1,"watchers_count":1,"language":"Scala","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":1,"default_branch":"master"}},"base":{"label":"akka:release-2.3-dev","ref":"release-2.3-dev","sha":"9bc85f1048e74c67e62789f13e37bce4b30e8bfc","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","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":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","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","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2015-07-14T10:26:03Z","pushed_at":"2015-07-14T13:58:05Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":263855,"stargazers_count":4213,"watchers_count":4213,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1227,"mirror_url":null,"open_issues_count":671,"forks":1227,"open_issues":671,"watchers":4213,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/17988"},"html":{"href":"https://github.com/akka/akka/pull/17988"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/17988"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/17988/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/17988/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/17988/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/91af328ebe17149132ac4661f05389e4dd57924d"}}}}