I was running into an issue. To test, I have the following response transformer:
LiftRules.responseTransformers.append { liftResponse =>
println("\n\nliftResponse " + S.uri + ": " + liftResponse + "\n\n")
liftResponse
}
When my LiftRules.dispath DispatchPF is defined like this (run implementation elided):
def apply(req: Req) = () => {
def run: Future[LiftResponse] = ???
Full(Await.result(run, Duration.Inf))
}
Then my response transformer runs even on requests handled by the DispatchPF. However if I change it to this:
def apply(req: Req) = () => {
def run: Future[LiftResponse] = ???
val f = LiftRules.getLiftSession(req).buildDeferredFunction(() => run)
RestContinuation.async { k =>
f().onComplete {
case Success(liftResponse) => k(liftResponse)
case Failure(e) =>
e.printStackTrace()
k(InternalServerErrorResponse())
}
}
}
Then even though the pages are served properly, the response transformer doesn't run on those requests.
Is this by design, a bug, or am I doing something wrong somewhere?
Thanks.