GitHub PullRequestEvent at 2014-07-31 13:56:54
Repository: akka
Actor: jrudolph
Payload: {"action":"opened","number":15609,"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/15609","id":19152368,"html_url":"https://github.com/akka/akka/pull/15609","diff_url":"https://github.com/akka/akka/pull/15609.diff","patch_url":"https://github.com/akka/akka/pull/15609.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/15609","number":15609,"state":"open","title":"Preview of current state of spray-routing ported to streams","user":{"login":"jrudolph","id":9868,"avatar_url":"https://avatars.githubusercontent.com/u/9868?v=1","gravatar_id":"64f6e19203e7846687b256f2ae4b6b0d","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":"**PREVIEW**\r\n\r\nThis already works somewhat. State of all the ported directive tests:\r\n\r\n```\r\nTests: succeeded 290, failed 0, canceled 0, ignored 0, pending 45\r\n```\r\n\r\nMost notably, the (un)marshalling infrastructure is only stubbed and not yet merged with @sirthias upcoming work. That means that Parameter and FormField directives are mostly not yet working.\r\n\r\nChanges from spray:\r\n\r\nRoute is now `RequestContext ⇒ RouteResult` with `RouteResult` being:\r\n\r\n```scala\r\nsealed trait RouteResult\r\ncase class CompleteWith(response: HttpResponse) extends RouteResult\r\ncase class RouteException(exception: Throwable) extends RouteResult\r\ncase class Rejected(rejections: List[Rejection]) extends RouteResult\r\ncase class DeferredResult(result: Future[RouteResult]) extends RouteResult\r\n```\r\n\r\n`HttpService` is now basically defined as\r\n\r\n```scala\r\nobject HttpService {\r\n  def handleConnections(serverConn: Future[Http.ServerBinding], materializer: FlowMaterializer)(route: Route)(implicit eh: ExceptionHandler, rh: RejectionHandler, rs: RoutingSettings, ec: ExecutionContext): Unit = //...\r\n}\r\n```\r\n\r\nwith a basic example server looking like this (see `TestServerWithRouting`):\r\n\r\n```scala\r\nval bindingFuture = (IO(Http) ? Http.Bind(interface = \"localhost\", port = 8080)).mapTo[Http.ServerBinding]\r\n\r\nimport Directives._\r\n\r\nHttpService.handleConnections(bindingFuture, materializer) {\r\n  get {\r\n    path(\"\") {\r\n      complete(index)\r\n    } ~\r\n    path(\"ping\") {\r\n      complete(\"PONG!\")\r\n    } ~\r\n    path(\"crash\") {\r\n      complete(sys.error(\"BOOM!\"))\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nOpen questions:\r\n  * Many directives now need an `ExecutionContext` and/or a `FlowMaterializer` because of the pervasive use of streams in HttpEntity and Futures for marshallers. In the current (= spray) design this means we need lots of magnets to be able to provide those implicitly. This quickly becomes unwieldy. There are these possible alternatives:\r\n     - current version that uses magnets everywhere\r\n     - enforce that Directives can only be built by implementing / mixing-in a context trait that supplies those implicit values\r\n     - supply those context variables through the `RequestContext`\r\n  * It seems `ChunkingDirectives` are not as necessary as before because you can always depend on the granularity of the ByteStrings in the HttpEntity data streams to provide basic \"chunking\", i.e. breaking down the size of byte blocks. Depending on the data source you maybe would still want to \"rechunk\" but it seems to be much less common than before where chunking was a preliminary to support gzip encoding of files.\r\n    ","created_at":"2014-07-31T13:56:53Z","updated_at":"2014-07-31T13:56:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/15609/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/15609/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akka/akka/issues/15609/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/4e496c86c91f4b8eb1d86da7f6133facff9e7e4a","head":{"label":"spray:w/init-http-routing","ref":"w/init-http-routing","sha":"4e496c86c91f4b8eb1d86da7f6133facff9e7e4a","user":{"login":"spray","id":688516,"avatar_url":"https://avatars.githubusercontent.com/u/688516?v=1","gravatar_id":"569910d257f4dca232c1c7fb29c100f0","url":"https://api.github.com/users/spray","html_url":"https://github.com/spray","followers_url":"https://api.github.com/users/spray/followers","following_url":"https://api.github.com/users/spray/following{/other_user}","gists_url":"https://api.github.com/users/spray/gists{/gist_id}","starred_url":"https://api.github.com/users/spray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spray/subscriptions","organizations_url":"https://api.github.com/users/spray/orgs","repos_url":"https://api.github.com/users/spray/repos","events_url":"https://api.github.com/users/spray/events{/privacy}","received_events_url":"https://api.github.com/users/spray/received_events","type":"Organization","site_admin":false},"repo":{"id":3809985,"name":"akka","full_name":"spray/akka","owner":{"login":"spray","id":688516,"avatar_url":"https://avatars.githubusercontent.com/u/688516?v=1","gravatar_id":"569910d257f4dca232c1c7fb29c100f0","url":"https://api.github.com/users/spray","html_url":"https://github.com/spray","followers_url":"https://api.github.com/users/spray/followers","following_url":"https://api.github.com/users/spray/following{/other_user}","gists_url":"https://api.github.com/users/spray/gists{/gist_id}","starred_url":"https://api.github.com/users/spray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spray/subscriptions","organizations_url":"https://api.github.com/users/spray/orgs","repos_url":"https://api.github.com/users/spray/repos","events_url":"https://api.github.com/users/spray/events{/privacy}","received_events_url":"https://api.github.com/users/spray/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spray/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/spray/akka","forks_url":"https://api.github.com/repos/spray/akka/forks","keys_url":"https://api.github.com/repos/spray/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spray/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spray/akka/teams","hooks_url":"https://api.github.com/repos/spray/akka/hooks","issue_events_url":"https://api.github.com/repos/spray/akka/issues/events{/number}","events_url":"https://api.github.com/repos/spray/akka/events","assignees_url":"https://api.github.com/repos/spray/akka/assignees{/user}","branches_url":"https://api.github.com/repos/spray/akka/branches{/branch}","tags_url":"https://api.github.com/repos/spray/akka/tags","blobs_url":"https://api.github.com/repos/spray/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spray/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spray/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/spray/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spray/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/spray/akka/languages","stargazers_url":"https://api.github.com/repos/spray/akka/stargazers","contributors_url":"https://api.github.com/repos/spray/akka/contributors","subscribers_url":"https://api.github.com/repos/spray/akka/subscribers","subscription_url":"https://api.github.com/repos/spray/akka/subscription","commits_url":"https://api.github.com/repos/spray/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/spray/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/spray/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/spray/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/spray/akka/contents/{+path}","compare_url":"https://api.github.com/repos/spray/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spray/akka/merges","archive_url":"https://api.github.com/repos/spray/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spray/akka/downloads","issues_url":"https://api.github.com/repos/spray/akka/issues{/number}","pulls_url":"https://api.github.com/repos/spray/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/spray/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/spray/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spray/akka/labels{/name}","releases_url":"https://api.github.com/repos/spray/akka/releases{/id}","created_at":"2012-03-23T15:57:31Z","updated_at":"2014-07-08T12:17:40Z","pushed_at":"2014-07-31T13:36:37Z","git_url":"git://github.com/spray/akka.git","ssh_url":"git@github.com:spray/akka.git","clone_url":"https://github.com/spray/akka.git","svn_url":"https://github.com/spray/akka","homepage":"http://akka.io","size":152220,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"akka:release-2.3-dev","ref":"release-2.3-dev","sha":"714aa503a4ece0f61ed9b5cf39979e6e11f164f7","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=1","gravatar_id":"0ff72320fb1bc5db35ba4fae61614eb0","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=1","gravatar_id":"0ff72320fb1bc5db35ba4fae61614eb0","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":"2014-07-31T06:43:54Z","pushed_at":"2014-07-30T16:14:24Z","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":219111,"stargazers_count":2802,"watchers_count":2802,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":763,"mirror_url":null,"open_issues_count":383,"forks":763,"open_issues":383,"watchers":2802,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/15609"},"html":{"href":"https://github.com/akka/akka/pull/15609"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/15609"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/15609/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/15609/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/15609/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/4e496c86c91f4b8eb1d86da7f6133facff9e7e4a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":29,"additions":9676,"deletions":10,"changed_files":111}}