병렬 요청은 일반 Guzzle에서와 똑같이 SDK에서 작동하며 MultiCurl을 이용합니다. 예를 들어, 당신이 뭔가를 할 수 있습니다 :
$message = 'Hello, world!';
$publishCommands = array();
foreach ($topicArns as $topicArn) {
$publishCommands[] = $sns->getCommand('Publish', array(
'TopicArn' => $topicArn,
'Message' => $message,
));
}
try {
$successfulCommands = $sns->execute($publishCommands);
$failedCommands = array();
} catch (\Guzzle\Service\Exception\CommandTransferException $e) {
$successfulCommands = $e->getSuccessfulCommands();
$failedCommands = $e->getFailedCommands();
}
foreach ($failedCommands as $failedCommand) { /* Handle any errors */ }
$messageIds = array();
foreach ($successfulCommands as $successfulCommand) {
$messageIds[] = $successfulCommand->getResult()->get('MessageId');
}
// Also Licensed under version 2.0 of the Apache License.
은 AWS SDK for PHP User Guide이 방식으로 명령 객체 작업에 대한 자세한 정보가 있습니다.
감사합니다. 이것은 훌륭합니다! – SteveMc