Application handlers should not write directly to the request
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IVLE |
Fix Released
|
Medium
|
William Grant |
Bug Description
All output from application handlers is currently written directly to the
request, by the application. This is bad, as it means that neither
exceptions nor transactions can be handled nicely.
We should alter the application specification to be more in line with other
frameworks, in that transaction management is handled by dispatch, and the
handlers should return a string rather than writing to the request object.
An application handler that returns without throwing an exception is
assumed to have completed successfully, and any transaction in progress
should be committed without the application having to explicitly ask for it.
The only issue I can see with this approach is that it will break streaming
in the 'serve' app. As we probably want to retain this ability, we could
provide a special case for it (particularly as it doesn't need the IVLE
header or footer).
Almost done, in new-dispatch.