Skip to content

Commit

Permalink
Merge pull request #1 from sidfeiner/migration-route-type
Browse files Browse the repository at this point in the history
Update migration-from-spray.md
  • Loading branch information
sidfeiner committed Dec 22, 2016
2 parents 127cfe1 + 2cfc9a5 commit c0417e2
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ All APIs are also available for Java. See everything under the `akka.http.javads

## Other changes


### Changes in Route type

Route type has changed from `Route = RequestContext ⇒ Unit` to `Route = RequestContext ⇒ Future[RouteResult]`.
Which means that now we must complete the Request inside the controller and we can't simply pass the request to another Actor and complete it there.
This has been done intentionally because in Spray people would forget to complete requests but the code would still compile.

The following article mentions a few ways for us to complete the request based on processing outside the controller:
https://markatta.com/codemonkey/blog/2016/08/03/actor-per-request-with-akka-http/

This article was written by Johan Andrén, a member of the akka-http team.

### Changes in Marshalling

Marshaller.of can be replaced with `Marshaller.withFixedContentType`.
Expand Down

0 comments on commit c0417e2

Please sign in to comment.