Skip to content

Instantly share code, notes, and snippets.

@muuki88
Created July 31, 2016 13:25
Show Gist options
  • Save muuki88/a0d0de8a4f6116c9c934af1e0116a829 to your computer and use it in GitHub Desktop.
Save muuki88/a0d0de8a4f6116c9c934af1e0116a829 to your computer and use it in GitHub Desktop.
// user endpoint which sets a UserContext
val userMean: Endpoint[MeanForUser] = get("weather" / "mean" / "user" :: long) { userId: Long =>
val userContext = UserContext(userId)
Contexts.broadcast.let(UserContext, userContext) {
client.mean().map(mean => Ok(MeanForUser(mean, userId)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment