I have a script that currently has a step where I trigger a voice broadcast after a customer signs up. It's a nusoap call to callfire.
The latency there is rather high, and it's added about 2 seconds to my sub-second sign up process. As a result, I have people hitting the sign up button more than once.
Is there a way to tell the app to NOT wait for the results and just move on?
It's possible to cheat by putting all of the nusoap code in a separate file, then open a socket to that file, but I'm looking for a cleaner way.
Or is there a way to fire off a function and not wait for the results? I don't think there is.
You can move the code to a cli script. Run the cli script from the web server PHP thread. The CLI process then forks, and the parent exits. The web thread can continue and the CLI child process can sign up the user.
In case of failure wih the SOAP call, I suggest you store the data somewhere and remove it or mark it as finished once is successfull. You can have a cron job routinely check to see if any calls failed, and retry them then notify someone (admin, user).