考虑以类似的类/伴随对象方式定义的异步操作:
class AuthenticatedAction[T](authorize: AuthenticatedRequest[_] => Future[Boolean]) extends ActionBuilder[AuthenticatedRequest] {...} //Modifies the request
object AuthenticatedAction {...}
class Action2() extends ActionBuilder[Request] {...}
object Action2 {...}
我想组合这两个动作,以便首先发生Action2。
override protected def composeAction[A](action: Action[A]): Action[A] = Action2().async(action.parser) { request =>
...
}
我一直无法弄清楚要在封闭体中放入什么来执行AuthenticatedAction.invokeblock
。
感谢任何见解。