ActionFunction

play.api.mvc.ActionFunction
trait ActionFunction[-R[_], +P[_]]

A builder for generic Actions that generalizes over the type of requests. An ActionFunction[R,P] may be chained onto an existing ActionBuilder[R] to produce a new ActionBuilder[P] using andThen. The critical (abstract) function is invokeBlock. Most users will want to use ActionBuilder instead.

Type parameters

P

the parameter type which blocks executed by this builder take (output)

R

the type of the request on which this is invoked (input)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Members list

Value members

Abstract methods

Attributes

Returns

The execution context to run the request in.

def invokeBlock[A](request: R[A], block: P[A] => Future[Result]): Future[Result]

Invoke the block. This is the main method that an ActionBuilder has to implement, at this stage it can wrap it in any other actions, modify the request object or potentially use a different class to represent the request.

Invoke the block. This is the main method that an ActionBuilder has to implement, at this stage it can wrap it in any other actions, modify the request object or potentially use a different class to represent the request.

Value parameters

block

The block of code to invoke

request

The request

Attributes

Returns

A future of the result

Concrete methods

def andThen[Q[_]](other: ActionFunction[P, Q]): ActionFunction[R, Q]

Compose this ActionFunction with another, with this one applied first.

Compose this ActionFunction with another, with this one applied first.

Value parameters

other

ActionFunction with which to compose

Attributes

Returns

The new ActionFunction

def compose[Q[_]](other: ActionFunction[Q, R]): ActionFunction[Q, P]

Compose another ActionFunction with this one, with this one applied last.

Compose another ActionFunction with this one, with this one applied last.

Value parameters

other

ActionFunction with which to compose

Attributes

Returns

The new ActionFunction

def compose[B](other: ActionBuilder[R, B]): ActionBuilder[P, B]