Browse Source

Merge pull request #2064 from dborovikov/round-14

update akka-http
Nate 9 years ago
parent
commit
f96f6c6c89

+ 2 - 2
frameworks/Scala/akka-http/build.sbt

@@ -9,8 +9,8 @@ scalaVersion := "2.11.7"
 resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"
 
 libraryDependencies ++= Seq(
-  "com.typesafe.akka" %% "akka-http-experimental" % "2.4.2",
-  "com.typesafe.akka" %% "akka-http-spray-json-experimental" % "2.4.2",
+  "com.typesafe.akka" %% "akka-http-experimental" % "2.4.7",
+  "com.typesafe.akka" %% "akka-http-spray-json-experimental" % "2.4.7",
   "mysql" % "mysql-connector-java" % "5.1.38",
   "org.apache.commons" % "commons-dbcp2" % "2.1",
   "org.scalatra.scalate" %% "scalate-core" % "1.7.0",

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/DbHandler.scala

@@ -35,7 +35,7 @@ class DbHandler(components: {
   def response = {
     val id = randomGenerator.next
     dataStore.findOne(id).map {
-      record => new HttpResponse(StatusCodes.OK, entity = HttpEntity(record.toResponse.toJson.toString()).withContentType(`application/json`))
+      record => HttpResponse(StatusCodes.OK, entity = HttpEntity(record.toResponse.toJson.toString()).withContentType(`application/json`))
     }
   }
 

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/FortunesHandler.scala

@@ -35,7 +35,7 @@ class FortunesHandler(components: {
     dataStore.getFortunes.map {
       fortunes =>
         val body = engine.layout("/templates/fortunes.mustache", Map("fortunes" -> fortunes))
-        new HttpResponse(StatusCodes.OK, entity = HttpEntity(body).withContentType(`text/html`.withCharset(`UTF-8`)))
+        HttpResponse(StatusCodes.OK, entity = HttpEntity(body).withContentType(`text/html`.withCharset(`UTF-8`)))
     }
 
   }

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/JsonHandler.scala

@@ -20,7 +20,7 @@ class JsonHandler(components: {
   }
 
   def response = {
-    new HttpResponse(StatusCodes.OK, entity = HttpEntity(Response("Hello, World!").toJson.toString()).withContentType(`application/json`))
+    HttpResponse(StatusCodes.OK, entity = HttpEntity(Response("Hello, World!").toJson.toString()).withContentType(`application/json`))
   }
 }
 

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/PlaintextHandler.scala

@@ -14,5 +14,5 @@ class PlaintextHandler(components: {
     }
   }
 
-  def response = new HttpResponse(StatusCodes.OK, entity = HttpEntity("Hello, World!").withContentType(`text/plain`.withCharset(`UTF-8`)))
+  def response = HttpResponse(StatusCodes.OK, entity = HttpEntity("Hello, World!").withContentType(`text/plain`.withCharset(`UTF-8`)))
 }

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/QueriesHandler.scala

@@ -54,7 +54,7 @@ class QueriesHandler(components: {
         id => dataStore.findOne(id)
       }
     }.map {
-      worlds => new HttpResponse(StatusCodes.OK, entity = HttpEntity(worlds.toList.map(_.toResponse).toJson.toString()).withContentType(`application/json`))
+      worlds => HttpResponse(StatusCodes.OK, entity = HttpEntity(worlds.toList.map(_.toResponse).toJson.toString()).withContentType(`application/json`))
     }
 
   }

+ 1 - 1
frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/UpdatesHandler.scala

@@ -52,7 +52,7 @@ class UpdatesHandler(components: {
     }.flatMap {
       worlds => Future.sequence(worlds.map(world => dataStore.updateOne(world.id, world.randomNumber).map(_ => world)))
     }.map {
-      worlds => new HttpResponse(StatusCodes.OK, entity = HttpEntity(worlds.map(_.toResponse).toJson.toString()).withContentType(`application/json`))
+      worlds => HttpResponse(StatusCodes.OK, entity = HttpEntity(worlds.map(_.toResponse).toJson.toString()).withContentType(`application/json`))
     }
   }
 }