src/MediaServices/MediaServicesRestProxy.php
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;
    }
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;
    }
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 ; }
Utility method to await for an Operation finishes.

@param Operation $operation The Operation object to await for
@param int       $interval

@return Operation
Utility method to await for an Operation finishes .