+str,htc #16071, #16072 New Stream Tcp and Http API

* StreamTcp and Http extensions now return Flows and Sources that can be materialized later
* Flow can now be completed with another flow to be turned into a runnable flow
This commit is contained in:
Björn Antonsson 2014-11-28 10:41:57 +01:00
parent cac9137aa9
commit 672d4ed091
43 changed files with 1327 additions and 1236 deletions

View file

@ -9,10 +9,8 @@ import akka.http.server.directives.AuthenticationDirectives._
import com.typesafe.config.{ ConfigFactory, Config }
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.io.IO
import akka.stream.FlowMaterializer
import akka.util.Timeout
import akka.pattern.ask
import akka.http.Http
import akka.http.model._
@ -26,7 +24,7 @@ object TestServer extends App {
implicit val materializer = FlowMaterializer()
implicit val askTimeout: Timeout = 500.millis
val bindingFuture = (IO(Http) ? Http.Bind(interface = "localhost", port = 8080)).mapTo[Http.ServerBinding]
val serverSource = Http(system).bind(interface = "localhost", port = 8080)
import ScalaRoutingDSL._
@ -40,7 +38,7 @@ object TestServer extends App {
// of #16190
implicit val html = ScalaXmlSupport.nodeSeqMarshaller(MediaTypes.`text/html`)
handleConnections(bindingFuture) withRoute {
handleConnections(serverSource) withRoute {
get {
path("") {
complete(index)