Calling fastcgi_finish_request in post_system event handler |
I need to do some processing after a request. I expect that most of the work will be sent to a worker through gearman, but if I can shave a ms or two by connecting to gearman after user gets the response I'd like to do so. With that in mind, is it safe to call fastcgi_finish_request in a 'post_system' event handler? The description says the buffer has already been sent to the browser, so is there anything I'm missing that would cause "abnormal behavior"?
Suppose I have an API returning a JSON-serialized object to a client. Can I use fastcgi_finish_request() in an After filter if I know, based on the route, that there is no more data that would be sent to the client?
I'm just not sure what is happening behind the scenes which I might end up breaking by using fastcgi_finish_request() in abnormal places. |
Welcome Guest, Not a member yet? Register Sign In |