WP File Manager
Current Path:
/
home
/
itutorethiopia
/
public_html
/
vendor
/
aws
/
aws-sdk-php
/
src
/
Name
Action
..
ACMPCA
Acm
AlexaForBusiness
Api
ApiGateway
AppSync
ApplicationAutoScaling
ApplicationDiscoveryService
Appstream
Athena
AutoScaling
AutoScalingPlans
AwsClient.php
Edit
AwsClientInterface.php
Edit
AwsClientTrait.php
Edit
Batch
Budgets
CacheInterface.php
Edit
ClientResolver.php
Edit
Cloud9
CloudDirectory
CloudFormation
CloudFront
CloudHSMV2
CloudHsm
CloudSearch
CloudSearchDomain
CloudTrail
CloudWatch
CloudWatchEvents
CloudWatchLogs
CodeBuild
CodeCommit
CodeDeploy
CodePipeline
CodeStar
CognitoIdentity
CognitoIdentityProvider
CognitoSync
Command.php
Edit
CommandInterface.php
Edit
CommandPool.php
Edit
Comprehend
ConfigService
Connect
CostExplorer
CostandUsageReportService
Credentials
Crypto
DAX
DLM
DataPipeline
DatabaseMigrationService
DeviceFarm
DirectConnect
DirectoryService
DoctrineCacheAdapter.php
Edit
DynamoDb
DynamoDbStreams
EKS
Ec2
Ecr
Ecs
Efs
ElastiCache
ElasticBeanstalk
ElasticLoadBalancing
ElasticLoadBalancingV2
ElasticTranscoder
ElasticsearchService
Emr
Endpoint
Exception
FMS
Firehose
GameLift
Glacier
Glue
Greengrass
GuardDuty
Handler
HandlerList.php
Edit
HasDataTrait.php
Edit
HashInterface.php
Edit
HashingStream.php
Edit
Health
History.php
Edit
Iam
IdempotencyTokenMiddleware.php
Edit
ImportExport
Inspector
IoT1ClickDevicesService
IoT1ClickProjects
IoTAnalytics
IoTJobsDataPlane
Iot
IotDataPlane
JsonCompiler.php
Edit
Kinesis
KinesisAnalytics
KinesisVideo
KinesisVideoArchivedMedia
KinesisVideoMedia
Kms
Lambda
LexModelBuildingService
LexRuntimeService
Lightsail
LruArrayCache.php
Edit
MQ
MTurk
MachineLearning
Macie
MarketplaceCommerceAnalytics
MarketplaceEntitlementService
MarketplaceMetering
MediaConvert
MediaLive
MediaPackage
MediaStore
MediaStoreData
MediaTailor
Middleware.php
Edit
MigrationHub
Mobile
MockHandler.php
Edit
MultiRegionClient.php
Edit
Multipart
Neptune
OpsWorks
OpsWorksCM
Organizations
PI
PhpHash.php
Edit
Pinpoint
Polly
PresignUrlMiddleware.php
Edit
Pricing
PsrCacheAdapter.php
Edit
Rds
Redshift
Rekognition
ResourceGroups
ResourceGroupsTaggingAPI
Result.php
Edit
ResultInterface.php
Edit
ResultPaginator.php
Edit
RetryMiddleware.php
Edit
Route53
Route53Domains
S3
SageMaker
SageMakerRuntime
Sdk.php
Edit
SecretsManager
ServerlessApplicationRepository
ServiceCatalog
ServiceDiscovery
Ses
Sfn
Shield
Signature
Sms
SnowBall
Sns
Sqs
Ssm
StorageGateway
Sts
Support
Swf
TraceMiddleware.php
Edit
TranscribeService
Translate
Waf
WafRegional
Waiter.php
Edit
WorkDocs
WorkMail
WorkSpaces
WrappedHttpHandler.php
Edit
XRay
data
functions.php
Edit
Editing: CommandPool.php
<?php namespace Aws; use GuzzleHttp\Promise\PromisorInterface; use GuzzleHttp\Promise\EachPromise; /** * Sends and iterator of commands concurrently using a capped pool size. * * The pool will read command objects from an iterator until it is cancelled or * until the iterator is consumed. */ class CommandPool implements PromisorInterface { /** @var EachPromise */ private $each; /** * The CommandPool constructor accepts a hash of configuration options: * * - concurrency: (callable|int) Maximum number of commands to execute * concurrently. Provide a function to resize the pool dynamically. The * function will be provided the current number of pending requests and * is expected to return an integer representing the new pool size limit. * - before: (callable) function to invoke before sending each command. The * before function accepts the command and the key of the iterator of the * command. You can mutate the command as needed in the before function * before sending the command. * - fulfilled: (callable) Function to invoke when a promise is fulfilled. * The function is provided the result object, id of the iterator that the * result came from, and the aggregate promise that can be resolved/rejected * if you need to short-circuit the pool. * - rejected: (callable) Function to invoke when a promise is rejected. * The function is provided an AwsException object, id of the iterator that * the exception came from, and the aggregate promise that can be * resolved/rejected if you need to short-circuit the pool. * - preserve_iterator_keys: (bool) Retain the iterator key when generating * the commands. * * @param AwsClientInterface $client Client used to execute commands. * @param array|\Iterator $commands Iterable that yields commands. * @param array $config Associative array of options. */ public function __construct( AwsClientInterface $client, $commands, array $config = [] ) { if (!isset($config['concurrency'])) { $config['concurrency'] = 25; } $before = $this->getBefore($config); $mapFn = function ($commands) use ($client, $before, $config) { foreach ($commands as $key => $command) { if (!($command instanceof CommandInterface)) { throw new \InvalidArgumentException('Each value yielded by ' . 'the iterator must be an Aws\CommandInterface.'); } if ($before) { $before($command, $key); } if (!empty($config['preserve_iterator_keys'])) { yield $key => $client->executeAsync($command); } else { yield $client->executeAsync($command); } } }; $this->each = new EachPromise($mapFn($commands), $config); } /** * @return \GuzzleHttp\Promise\PromiseInterface */ public function promise() { return $this->each->promise(); } /** * Executes a pool synchronously and aggregates the results of the pool * into an indexed array in the same order as the passed in array. * * @param AwsClientInterface $client Client used to execute commands. * @param mixed $commands Iterable that yields commands. * @param array $config Configuration options. * * @return array * @see \Aws\CommandPool::__construct for available configuration options. */ public static function batch( AwsClientInterface $client, $commands, array $config = [] ) { $results = []; self::cmpCallback($config, 'fulfilled', $results); self::cmpCallback($config, 'rejected', $results); return (new self($client, $commands, $config)) ->promise() ->then(static function () use (&$results) { ksort($results); return $results; }) ->wait(); } /** * @return callable */ private function getBefore(array $config) { if (!isset($config['before'])) { return null; } if (is_callable($config['before'])) { return $config['before']; } throw new \InvalidArgumentException('before must be callable'); } /** * Adds an onFulfilled or onRejected callback that aggregates results into * an array. If a callback is already present, it is replaced with the * composed function. * * @param array $config * @param $name * @param array $results */ private static function cmpCallback(array &$config, $name, array &$results) { if (!isset($config[$name])) { $config[$name] = function ($v, $k) use (&$results) { $results[$k] = $v; }; } else { $currentFn = $config[$name]; $config[$name] = function ($v, $k) use (&$results, $currentFn) { $currentFn($v, $k); $results[$k] = $v; }; } } }