Here is what I would like to do in chronological order:
[list=1]
[*]Let my Action handle the request,
[*]Respond by render()
[*]Do user-specific maintenance and cleanup.
[/list]
The rub is, of course, is 3. Here is my train of thought:
After the server has sent the response, we have some ‘free time’ on the server. By ‘free time’, I mean that the server can do computations that do not affect the user-experience. After all, the user already has his response.
I would like to use this time to do some DB-logging & DB-cleanup.
Is there anything in Yii that can be used for this purpose?
There is no afterProcessOutput() in Yii 1.1.12+ … or is there?
When I google, I do see references to CController::afterProcessOutput(). Was this perhaps included in previous versions of Yii?
I have looked at a bunch of tutorials and explanations, which only served to confuse me further. Except that one post on StackOverflow, which made sense…
However, as I detailed above, when copy-pasting Jonathan’s code (on SO), it fires the event no less than eight times…
Never mind. I have got it. I have EventSource running, so there is a steady stream of requests and for each End of Request, the database is now updated…