I need to call a webservice from a PHP script. The web service is slow, and I’m not interested in its response, I only want to send data to it.
I’m trying to use curl_multi_exec (following an example here: http://www.jaisenmathai.com/articles/php-curl-asynchronous.html), and it’s second parameter ($still_running) lets you know when its done sending AND receiving. But, again, I’m only interested in knowing when my script is done sending. Of course, if I exit the script before its done sending the data, the web service never registers receiving the request.
Another way to look at it is to detect when PHP is idle, waiting for a response from the server.
What I’d like to achieve is this dialogue:
- PHP: Hi, please save this data
- WS: Ok, ho hum, lets think about this.
- PHP: Cya! (off to do something more important)
- WS: Ok, Im done processing, here is your response… PHP? Where did you go? I feel used 🙁
You can try
Output
Simple Test Server server.php