Skip to content

Instantly share code, notes, and snippets.

@josephpconley
Last active August 29, 2015 13:56
Show Gist options
  • Save josephpconley/9345746 to your computer and use it in GitHub Desktop.
Save josephpconley/9345746 to your computer and use it in GitHub Desktop.
//Composed action to handle logging and measuring in same request
object LoggedMeasured extends ActionBuilder[Request] {
def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[SimpleResult]) = block(request)
override def composeAction[A](action: Action[A]) = Logged(Measured(action))
}
object Application extends Controller{
def batch = LoggedMeasured {
val result = User.batchUpload
Ok(result.toString)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment