Ver Fonte

Merge pull request #1736 from DanSimon/colossus-upgrade

colossus: upgrading to latest version
blee-techempower há 10 anos atrás
pai
commit
4a8c669e70

+ 3 - 3
frameworks/Scala/colossus/build.sbt

@@ -1,14 +1,14 @@
 name := """colossus-example"""
 
-version := "0.2.0"
+version := "0.2.1"
 
-scalaVersion := "2.11.6"
+scalaVersion := "2.11.7"
 
 com.github.retronym.SbtOneJar.oneJarSettings
 
 mainClass in oneJar := Some("example.Main")
 
 libraryDependencies ++= Seq(
-  "com.tumblr" %% "colossus" % "0.6.4-RC1",
+  "com.tumblr" %% "colossus" % "0.6.6-RC2",
   "net.liftweb" %% "lift-json" % "2.6-RC1"
 )

+ 6 - 6
frameworks/Scala/colossus/src/main/scala/example/Main.scala

@@ -34,9 +34,9 @@ object BenchmarkService {
     }
   }
   val response          = ByteString("Hello, World!")
-  val plaintextHeader   = ("Content-Type", "text/plain")
-  val jsonHeader        = ("Content-Type", "application/json")
-  val serverHeader      = ("Server", "Colossus")
+  val plaintextHeader   = HttpResponseHeader("Content-Type", "text/plain")
+  val jsonHeader        = HttpResponseHeader("Content-Type", "application/json")
+  val serverHeader      = HttpResponseHeader("Server", "Colossus")
 
 
   def start(port: Int)(implicit io: IOSystem) {
@@ -46,7 +46,7 @@ object BenchmarkService {
       maxConnections = 16384,
       tcpBacklogSize = Some(1024)
     )
-    val serviceConfig = ServiceConfig(
+    val serviceConfig = ServiceConfig[HttpRequest, HttpResponse](
       name = "/sample",
       requestTimeout = Duration.Inf,
       requestMetrics = false
@@ -55,10 +55,10 @@ object BenchmarkService {
     val server = Service.serve[Http](serverConfig, serviceConfig) { context =>
 
       ///the ??? is filled in almost immediately by the actor
-      var dateHeader = ("Date", "???")
+      var dateHeader = HttpResponseHeader("Date", "???")
 
       context.receive {
-        case ts: String => dateHeader = ("Date", ts)
+        case ts: String => dateHeader = HttpResponseHeader("Date", ts)
       }
       
       context.handle { connection =>