I noticed that requests are not sent asynchronously no matter I call methods like \Microsoft\Kiota\Http\GuzzleRequestAdapter::sendPrimitiveAsync()
It ends up with calling the sync Guzzle send() method:
\GuzzleHttp\Client::send()
Example of the code:
<?php
require 'vendor/autoload.php';
use Microsoft\Kiota\Authentication\Oauth\ClientCredentialContext;
use Microsoft\Graph\GraphServiceClient;
// skip auth
$graphServiceClient = new GraphServiceClient($tokenRequestContext);
$files = [
'XXX' => 'XXX.jpg', // IDs are changed
'YYY' => 'YYY.jpg',
'ZZZ' => 'ZZZ.jpg',
];
foreach ($files as $fileId => $fileName) {
print("Downloading file $fileName\n");
$promise = $graphServiceClient->drives()
->byDriveId('AAAAAAAAAA')->items()
->byDriveItemId($fileId)->content()->get()->then(
function($fileContent) use ($fileName) {
print("File $fileName downloaded successfully\n");
file_put_contents($fileName, $fileContent);
}
);
}
Every file download is running synchronously, but I expect it running in parallel.
Thanks.
I noticed that requests are not sent asynchronously no matter I call methods like \Microsoft\Kiota\Http\GuzzleRequestAdapter::sendPrimitiveAsync()
It ends up with calling the sync Guzzle send() method:
\GuzzleHttp\Client::send()
Example of the code:
Every file download is running synchronously, but I expect it running in parallel.
Thanks.