Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5 from fommil/master

Imports in home.scala
  • Loading branch information...
commit 480631d30461e088f2563649e6e4d17b84c216a9 2 parents cf7a5ba + 593dca9
Jan Machacek authored
8 sbt/src/main/scala/org/cakesolutions/akkapatterns/api/home.scala
View
@@ -5,7 +5,7 @@ import spray.routing.Directives
import java.net.InetAddress
import akka.pattern.ask
import org.cakesolutions.akkapatterns.core.application.{ PoisonPill, GetImplementation, Implementation }
-import spray.httpx.SprayJsonSupport
+import spray.httpx.SprayJsonSupport._
import spray.httpx.marshalling.MetaMarshallers
case class SystemInfo(implementation: Implementation, host: String)
@@ -19,17 +19,15 @@ class HomeService(implicit val actorSystem: ActorSystem) extends Directives with
get {
complete {
import scala.concurrent.ExecutionContext.Implicits._
- val futureInfo = (applicationActor ? GetImplementation()).mapTo[Implementation].map {
+ (applicationActor ? GetImplementation()).mapTo[Implementation].map {
SystemInfo(_, InetAddress.getLocalHost.getCanonicalHostName)
}
- // how to get this to implicitly return as a future marshaller of a SystemInfo marshaller?
- futureInfo
}
}
} ~
path("poisonpill") {
post {
- completeWith {
+ complete {
applicationActor ! PoisonPill()
"Goodbye"
Please sign in to comment.
Something went wrong with that request. Please try again.