How to call destructor after response in php?
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"; } }
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.