final public function get(array $query, array $options = []) : array
    {
        $completeQuery = $this->buildPayloadQuery(
            ['earliestGet' => ['$lte' => new UTCDateTime((int)(microtime(true) * 1000))]],
            $query
        );

        $options += self::DEFAULT_GET_OPTIONS;
        $update = ['$set' => ['earliestGet' => $this->calculateEarliestGet($options['runningResetDuration'])]];
        $end = $this->calculateEndTime($options['waitDurationInMillis']);
        $sleepTime = $this->calculateSleepTime($options['pollDurationInMillis']);
        $messages = new ArrayObject();
        while (count($messages) < $options['maxNumberOfMessages']) {
            if ($this->tryFindOneAndUpdate($completeQuery, $update, $messages)) {
                continue;
            }

            if (microtime(true) < $end) {
                usleep($sleepTime);
            }

            break;
        }

        return $messages->getArrayCopy();
    }