Last active
August 29, 2015 13:56
-
-
Save josephpconley/9345746 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//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