Skip to content

Instantly share code, notes, and snippets.

@vheaffinitech
Created April 14, 2017 21:22
Show Gist options
  • Save vheaffinitech/c672d6940567cfdee69670a4b4ebcc85 to your computer and use it in GitHub Desktop.
Save vheaffinitech/c672d6940567cfdee69670a4b4ebcc85 to your computer and use it in GitHub Desktop.
val route =
path("req") {
get {
parameter("name") { name =>
requestActor ! Req(name)
complete(s"Request sent for $name ! ")
}
}
} ~
path("reqresp") {
get {
parameter("name") { name =>
val future = requestResponseActor ? Req(name)
val s = Await.result(future, timeout.duration).asInstanceOf[String]
complete(s"Actor response is : $s")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment