1

Consider async actions that are both defined in a similar class/companion object way:

class AuthenticatedAction[T](authorize: AuthenticatedRequest[_] => Future[Boolean]) extends ActionBuilder[AuthenticatedRequest] {...} //Modifies the request

object AuthenticatedAction {...}

class Action2() extends ActionBuilder[Request] {...}

object Action2 {...}

I want to compose these two actions so that Action2 happens first.

override protected def composeAction[A](action: Action[A]): Action[A] = Action2().async(action.parser) { request =>

...

}

I have been unable to figure out what to put into the body of the closure to execute AuthenticatedAction.invokeblock.

Any insight is appreciated.

Vidya
  • 29,932
  • 7
  • 42
  • 70
  • Have you looked at http://stackoverflow.com/questions/29978399/play-framework-chain-actionsbuilder-and-actionrefiner/29980026#29980026 ? – millhouse Jul 09 '15 at 05:44
  • I had not. I will give `andThen` a try. I have seen it in some docs, but so few people seem to do it that way that I thought it might be frowned upon for whatever reason. Thanks for the comment. – Vidya Jul 09 '15 at 14:06

0 Answers0