Created
June 15, 2016 02:04
-
-
Save searler/fc2e0d33efc3e03aad8873e2ab408263 to your computer and use it in GitHub Desktop.
Akka HTTP command route using Objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def command(marker:Command) = path("app" / "command" / marker.toString) { | |
post { | |
entity(as[String]) { _ => | |
actorRef ! marker | |
complete(StatusCodes.OK) | |
} | |
} | |
} | |
trait Command | |
case object Reboot extends Command | |
case object RotateLogs extends Command | |
val route = command(Reboot) ~ | |
command(RotateLogs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment