src/Repository/DynamoDb/BatchGetItemRequest.php
public function getItems(): array
    {
        $allItems = [];

        while ($this->queue) {
            $commands = $this->prepareCommands();
            $pool = new CommandPool($this->client, $commands, [
                'concurrency' => $this->poolSize,
                'fulfilled'   => function (ResultInterface $result) use (&$allItems) {
                    if ($result->hasKey('UnprocessedKeys')) {
                        $this->retryUnprocessed($result['UnprocessedKeys']);
                    }

                    foreach ((array)$result->get('Responses') as $tableName => $items) {
                        $allItems = array_merge($allItems, $items);
                    }
                },
                'rejected'    => function ($reason) {
                    if ($reason instanceof AwsException) {
                        if ('ProvisionedThroughputExceededException' === $reason->getAwsErrorCode()) {
                            $this->retryUnprocessed($reason->getCommand()['RequestItems']);
                            return;
                        }

                        if (is_callable($this->errorFunc)) {
                            $func = $this->errorFunc;
                            $func($reason);
                        }
                    }
                },
            ]);

            $pool->promise()->wait();
        }

        return $allItems;
    }
public function getItems(): array
    {
        $allItems = [];

        while ($this->queue) {
            $commands = $this->prepareCommands();
            $pool = new CommandPool($this->client, $commands, [
                'concurrency' => $this->poolSize,
                'fulfilled'   => function (ResultInterface $result) use (&$allItems) {
                    if ($result->hasKey('UnprocessedKeys')) {
                        $this->retryUnprocessed($result['UnprocessedKeys']);
                    }

                    foreach ((array)$result->get('Responses') as $tableName => $items) {
                        $allItems = array_merge($allItems, $items);
                    }
                },
                'rejected'    => function ($reason) {
                    if ($reason instanceof AwsException) {
                        if ('ProvisionedThroughputExceededException' === $reason->getAwsErrorCode()) {
                            $this->retryUnprocessed($reason->getCommand()['RequestItems']);
                            return;
                        }

                        if (is_callable($this->errorFunc)) {
                            $func = $this->errorFunc;
                            $func($reason);
                        }
                    }
                },
            ]);

            $pool->promise()->wait();
        }

        return $allItems;
    }
public function getItems ( ) : array { $ allItems = [ ] ; while ( $ this -> queue ) { $ commands = $ this -> prepareCommands ( ) ; $ pool = new CommandPool ( $ this -> client , $ commands , [ 'concurrency' => $ this -> poolSize , 'fulfilled' => function ( ResultInterface $ result ) use ( & $ allItems ) { if ( $ result -> hasKey ( 'UnprocessedKeys' ) ) { $ this -> retryUnprocessed ( $ result [ 'UnprocessedKeys' ] ) ; } foreach ( ( array ) $ result -> get ( 'Responses' ) as $ tableName => $ items ) { $ allItems = array_merge ( $ allItems , $ items ) ; } } , 'rejected' => function ( $ reason ) { if ( $ reason instanceof AwsException ) { if ( 'ProvisionedThroughputExceededException' === $ reason -> getAwsErrorCode ( ) ) { $ this -> retryUnprocessed ( $ reason -> getCommand ( ) [ 'RequestItems' ] ) ; return ; } if ( is_callable ( $ this -> errorFunc ) ) { $ func = $ this -> errorFunc ; $ func ( $ reason ) ; } } } , ] ) ; $ pool -> promise ( ) -> wait ( ) ; } return $ allItems ; }
Processes the batch by combining all the queued requests into
BatchGetItem commands and executing them. UnprocessedKeys
are automatically re-queued.

@return array
Processes the batch by combining all the queued requests into BatchGetItem commands and executing them . UnprocessedKeys are automatically re - queued .