miyagawa/Starman — pull request #52 by avar (2012-09-11 20:49:03+00:00)
Title: Implement support for the PSGI environment cleanup handlers proposal

Implement the proposal at
https://github.com/plack/psgi-specs/wiki/Proposal:-PSGI-environment-cleanup-handlers. This
seems to work for me, at least the subroutines get run, and you can
e.g. "sleep 10" in the cleanup handler without holding up the request.

One potential caveat here is that by passing the $env hash to the
post_client_connection_hook routine we might be causing something
evil, but I haven't spotted any problems.

Consider this an RFC, but maybe it's good to merge as-is.