Reputation: 2556
In Play 2.3, the Action.async
method has the signature
final def async(block: ⇒ Future[Result]): Action[AnyContent]
I did not figure out the meaning of => Future[Result]
, is it an anonymous function? Then shouldn't it be () => Future[Result]
?
Upvotes: 3
Views: 303
Reputation: 940
This is a call by name not by value as usual. It means, the argument, here block is of Type Future[Result] and it is lazy evaluated when needed not instantly on function call.
Upvotes: 0
Reputation: 8113
It is a "By-name parameter":
Upvotes: 3