Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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