-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support psgix.cleanup (and psgix.cleanup.handlers) #132
base: master
Are you sure you want to change the base?
Conversation
probably a dupe of #53 |
Hmm, I think you're right. Wish I'd done a better job searching for that first 😝 I'll see if I can wake up that seven-year-old PR. Assuming I can, I'm happy to close this one. |
@miyagawa I think that branch is too old to re-garner momentum. I'm happy to implement turning off keep-alive connections when there are cleanup handlers here, would you be okay with that? |
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.
(no additional testing, as keepalive behavior isn't currently tested or easily accessible from tests).
I refactored to use #53 (since that correctly handled cleanup-harakiri interaction), and added the requested |
:( |
@miyagawa - any chance this can be merged into a release? |
This PR adds psgix.cleanup* handling to Starman.