我的问题是 SimpleResult 似乎不允许对其会话进行读取访问,仅允许写入访问(withSession)。
object MyAction extends ActionBuilder[MyRequest] {
def invokeBlock[A](
request: Request[A],
block: (MyRequest[A]) => Future[SimpleResult]
): Future[SimpleResult] = {
// do stuff, create x, y
val resultFuture = block(MyRequest(x, y, request)
// Now I want to modify resultFuture's session,
// keeping any changes block might have done to request.session.
// And I'd rather not parse result's headers by hand to do that.
}
}
我错过了什么?