public function awaitOperation(Operation $operation, $interval = 5)
    {
        while ($operation->getState() == OperationState::InProgress) {
            $operation = $this->getOperation($operation);
            if ($operation->getState() == OperationState::InProgress) {
                sleep($interval);
            }
        }

        return $operation;
    }