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;
    }