Skip to content

Implement support for the PSGI environment cleanup handlers proposal#53

Open
avar wants to merge 1 commit intomiyagawa:masterfrom
avar:support-for-cleanup-handler-proposal
Open

Implement support for the PSGI environment cleanup handlers proposal#53
avar wants to merge 1 commit intomiyagawa:masterfrom
avar:support-for-cleanup-handler-proposal

Conversation

@avar
Copy link

@avar avar commented Sep 12, 2012

This should address the issues noted in #52

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 with it so far.

Note that we have to re-check the harakiri flag in
post_client_connection_hook because the cleanup handlers might set it.

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 with it so far.

Note that we have to re-check the harakiri flag in
post_client_connection_hook because the cleanup handlers might set it.
@jrubinator
Copy link

It sounds like the general consensus here is that in order to enable the cleanup handlers, we should be turning off keepalive. If I were to add that here, would this patch be likely to merge?

@jrubinator
Copy link

(See also #132 which I think supersedes this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants