1. Go to this page and download the library: Download meabed/php-parallel-soap library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$client->setMulti(true);
$client->setCurlOptions([
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
]);
// Each call returns a request id instead of a result while in parallel mode.
$id1 = $client->Add(['intA' => 4, 'intB' => 3]);
$id2 = $client->Add(['intA' => 10, 'intB' => 20]);
$id3 = $client->Add(['intA' => 10, 'intB' => 20]); // identical payload => same id as $id2
// Fire every queued request concurrently. The client resets to single mode afterwards.
$responses = $client->run();
echo $responses[$id1]; // 7
echo $responses[$id2]; // 30
$responses = $client->run();
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
// Network error, malformed response, server fault, ...
echo "Error for {$id}: {$response->getMessage()}\n";
continue;
}
echo "OK {$id}: {$response}\n";
}
$responses = $client->run([$id1, $id3]); // only execute these two
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.