I am trying to transfer a few files from an s3 bucket to my laptop. When I do the transfer synchronously, like this, it works fine: $manager = new \Aws\S3\Transfer($client, $source, $dest); $manager->transfer();
But when i try to do the same transfer aynch like this:
$manager = new \Aws\S3\Transfer($client, $source, $dest);
$promise = $manager->promise();
$promise->then(function () {
echo 'Done!';
});
$promise->otherwise(function ($reason) {
echo 'Transfer failed: ';
});
In this asynch case, the files are never transferred. The async code above is directly from AWS php SDK documentation. Is there something that they forgot to mention in the docs?