Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Run $kernel->terminate after connection is closed in HHVM #658

Closed
wants to merge 3 commits into from

Conversation

lmcd
Copy link

@lmcd lmcd commented May 9, 2014

In php-fpm, we can run cleanup code/blocking tasks after the HTTP connection is closed with fastcgi_finish_request. HHVM doesn't have this function, but it does have the counterpart register_postsend_function.

See here:
https://github.com/facebook/hhvm/blob/master/hphp/doc/extension.new_functions
facebook/hhvm#1230

Note: haven't tested yet. Just putting it out there.

register_postsend_function($postSend);
}
else {
$postSend();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid defining a closure and calling it immediately for non-HHVM. Just put the $kernel->terminate($request, $response); call directly.

@fabpot
Copy link
Member

fabpot commented Jul 8, 2014

@lmcd Have you tested this? Is it ready to be merged?

@lmcd
Copy link
Author

lmcd commented Jul 8, 2014

I haven't been able to test it yet in a stable HHVM setup. Happy for someone else to do so.

@allan-simon
Copy link

Hello, how can one test this ?

@alesblaznik
Copy link

@lmcd I've tested it just now on HipHop VM 3.6.2 (rel) and it works as expected - not any issues so far.

@fabpot Should this be added to Symfony standard since a lot of folks are starting to use HHVM nowadays and actually it took me a while to recognize that fast_cgi_request_finish don't work on hhvm? Maybe for now it could be enough that this lines should be commented and say "uncomment this, if you're using hhvm"

@fabpot
Copy link
Member

fabpot commented May 15, 2015

If the code works, let's see where this should be added in Symfony itself.

@hacfi
Copy link

hacfi commented Jul 7, 2016

We could close this!? If it’s really missing someone will notice, test it and this can be merged.

@fabpot
Copy link
Member

fabpot commented Jul 8, 2016

As HHVM is not a priority for the core team, nobody is using it (we even discussed removing its official support in Symfony), someone using HHVM should finish this change so that we can merge it. In any case, it cannot be merge as is as this should be part of Symfony, not the standard edition.

@fabpot
Copy link
Member

fabpot commented Aug 18, 2016

Closing this one as apparently nobody has the issue... or nobody uses HHVM and Symfony.

@fabpot fabpot closed this Aug 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants