diff options
Diffstat (limited to 'aws/aws-sdk-php/src/MultiRegionClient.php')
-rw-r--r-- | aws/aws-sdk-php/src/MultiRegionClient.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/aws/aws-sdk-php/src/MultiRegionClient.php b/aws/aws-sdk-php/src/MultiRegionClient.php index fce855b5..632dfcc6 100644 --- a/aws/aws-sdk-php/src/MultiRegionClient.php +++ b/aws/aws-sdk-php/src/MultiRegionClient.php @@ -22,6 +22,8 @@ class MultiRegionClient implements AwsClientInterface private $handlerList; /** @var array */ private $aliases; + /** @var callable */ + private $customHandler; public static function getArguments() { @@ -112,6 +114,11 @@ class MultiRegionClient implements AwsClientInterface list($region, $args) = $this->getRegionFromArgs($command->toArray()); $command = $this->getClientFromPool($region) ->getCommand($command->getName(), $args); + + if ($this->isUseCustomHandler()) { + $command->getHandlerList()->setHandler($this->customHandler); + } + return $this->executeAsync($command); }); @@ -191,6 +198,16 @@ class MultiRegionClient implements AwsClientInterface return $this->getClientFromPool()->getEndpoint(); } + public function useCustomHandler(callable $handler) + { + $this->customHandler = $handler; + } + + private function isUseCustomHandler() + { + return isset($this->customHandler); + } + /** * @param string $region Omit this argument or pass in an empty string to * allow the configured client factory to apply the |