PHP Async Web Services
asynchronous, php, web-services
Solution
My immediate answer should be: You can't. PHP does not have threading abilities that can be used in "userland".
Now if you really want to do it, there are some ways you can go around it:
- Use the exec functions to spawn another process, in the background, and monitor it through the database/file system or whatever.
- Use the fork function to spawn another process and monitor it through the database/file system or whatever.
Setbacks of these 2 approaches is that you can make it asynchronous but if you want a callback then it's going to be very tricky and not at all trivial. Well, it ain't even gonna be a callback since you'll not be able to wait for it on the script that makes the async call. This means that you can only have some kind of monitoring scheme. I would suggest AJAX.
Problem
How do I make an asynchronous call to a web service using the `PHP SOAP Extension`?