on-internet
← Community

How to call destructor after response in php?

Stack Overflow ·

I have a chat bot which save some data into db which user is sending. I want to save it to db (a slow network call) after sending response to the user. I could do that in Python Tornado but I havent been able to do it PHP Apache. user sends input as request -> we process it -> we send output to user as response -> then we wish to store data class A { function __construct() { echo "Hello World"; } function __destruct() { sleep(15); //I want this to happen after response is being send } function calc() { echo "Progress World"; } }

Comments

Sign in or sign up to comment and upvote.

No comments yet.