Last active
May 12, 2019 19:04
-
-
Save dabd/a9af4dfa2825a30c86cedcd0d83e2c5c to your computer and use it in GitHub Desktop.
This file contains 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
trait ActionBuilder2[+R[_]] extends ActionBuilder[R] { self => | |
def async2(block: => Task[Result]): Action[AnyContent] = | |
async(block runAsync) | |
def async2(block: R[AnyContent] => Task[Result]): Action[AnyContent] = | |
async(block(_) runAsync) | |
def async2[A](bodyParser: BodyParser[A])(block: R[A] => Task[Result]): Action[A] = | |
async(bodyParser)(block(_) runAsync) | |
def andThen2[Q[_]](other: ActionFunction[R, Q]): ActionBuilder2[Q] = new ActionBuilder2[Q] { | |
def invokeBlock[A](request: Request[A], block: Q[A] => Future[Result]): Future[Result] = | |
self.invokeBlock[A](request, other.invokeBlock[A](_, block)) | |
override protected def composeParser[A](bodyParser: BodyParser[A]): BodyParser[A] = | |
self.composeParser(bodyParser) | |
override protected def composeAction[A](action: Action[A]): Action[A] = | |
self.composeAction(action) | |
} | |
} | |
trait ActionFilter2[R[_]] extends ActionFilter[R] { | |
override final protected def filter[A](request: R[A]): Future[Option[Result]] = { | |
filter2(request) runAsync | |
} | |
def filter2[A](request: R[A]): Task[Option[Result]] | |
} | |
trait ActionRefiner2[-R[_], +P[_]] extends ActionRefiner[R, P] { | |
override final protected def refine[A](request: R[A]): Future[Either[Result, P[A]]] = | |
refine2(request) runAsync | |
def refine2[A](request: R[A]): Task[Either[Result, P[A]]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone else reading this, it would appear to be for an older version of Play (pre 2.7)