I have an application that accepts requests and process them.
I'm planning to add to this script execution a curl to forward the call to another service (for service migration and testing purposes)
I want to be sure that this request forwarding via curl won't slow down application performance or server in general.
Some pseudo code:
//Step 1: existing code
//handle the request
$req = new requestHandler($_REQUEST);
//process the request
$req->process();
//Step 2 (TODO): add request forwarding here (unique request do not need to perform multi curls)
$forward = new requestForwarding($_REQUEST);
$forward->fire();
//step3 (don't want this to be delayed by step 2)
$req->printAnswer();
What can I do at step 2 to not affect or minimise the general impact of the request forward?
Am I worrying for nothing and I can implement it with a simple curl? Or should I take some precautions?
Thanks