Represent and interact with a Long Running Operation.

CloneableInstantiable
Constants
public Google\Cloud\Core\LongRunning\LongRunningOperation::STATE_ERROR = 'error'
public Google\Cloud\Core\LongRunning\LongRunningOperation::STATE_IN_PROGRESS = 'inProgress'
public Google\Cloud\Core\LongRunning\LongRunningOperation::STATE_SUCCESS = 'success'
public Google\Cloud\Core\LongRunning\LongRunningOperation::WAIT_INTERVAL = 1
Methods
public __construct(Google\Cloud\Core\LongRunning\LongRunningConnectionInterface $connection, $name, array $callablesMap, array $info = [])
 
    public __debugInfo()
     
    • access private
    public cancel(array $options = [])
     

    Cancel a Long Running Operation.

    Example:

    $operation->cancel();
    
    • return void
    public delete(array $options = [])
     

    Delete a Long Running Operation.

    Example:

    $operation->delete();
    
    • return void
    public done(array $options = [])
     

    Check if the Operation is done.

    If the Operation state is not available, a service request may be executed
    by this method.

    Example:

    if ($operation->done()) {
        echo "The operation is done!";
    }
    
    • return bool
    public error(array $options = [])
     

    Get the Operation error.

    Returns null if the Operation is not yet complete, or if no error occurred.

    If the Operation state is not available, a service request may be executed
    by this method.

    Example:

    $error = $operation->error();
    
    • return array|null
    public info(array $options = [])
     

    Get the Operation info.

    If the Operation state is not available, a service request may be executed
    by this method.

    Example:

    $info = $operation->info();
    
    • codingStandardsIgnoreStart
    • return array [google.longrunning.Operation](https://cloud.google.com/spanner/docs/reference/rpc/google.longrunning#google.longrunning.Operation)
    • codingStandardsIgnoreEnd
    public name()
     

    Return the Operation name.

    Example:

    $name = $operation->name();
    
    • return string
    public pollUntilComplete(array $options = [])
     

    Reload the operation until it is complete.

    The return type of this method is dictated by the type of Operation. If
    $options.maxPollingDurationSeconds is set, and the poll exceeds the
    limit, the return will be null.

    Example:

    $result = $operation->pollUntilComplete();
    
    • return mixed|null
    public reload(array $options = [])
     

    Reload the Operation to check its status.

    Example:

    $result = $operation->reload();
    
    • codingStandardsIgnoreStart
    • return array [google.longrunning.Operation](https://cloud.google.com/spanner/docs/reference/rpc/google.longrunning#google.longrunning.Operation)
    • codingStandardsIgnoreEnd
    public result(array $options = [])
     

    Get the Operation result.

    The return type of this method is dictated by the type of Operation.

    Returns null if the Operation is not yet complete, or if an error occurred.

    If the Operation state is not available, a service request may be executed
    by this method.

    Example:

    $result = $operation->result();
    
    • return mixed|null
    public state(array $options = [])
     

    Get the state of the Operation.

    Return value will be one of LongRunningOperation::STATE_IN_PROGRESS,
    LongRunningOperation::STATE_SUCCESS or
    LongRunningOperation::STATE_ERROR.

    If the Operation state is not available, a service request may be executed
    by this method.

    Example:

    switch ($operation->state()) {
        case LongRunningOperation::STATE_IN_PROGRESS:
            echo "Operation is in progress";
            break;
    
        case LongRunningOperation::STATE_SUCCESS:
            echo "Operation succeeded";
            break;
    
        case LongRunningOperation::STATE_ERROR:
            echo "Operation failed";
            break;
    }
    
    • return string
    Properties
    private $callablesMap
     
    • var array
    private $connection
    private $error
     
    • var array|null
    private $info
     
    • var array
    private $name
     
    • var string
    private $result
     
    • var array|null
    Methods
    private executeDoneCallback( $type, $response)
     

    When the Operation is complete, there may be a callback enqueued to
    handle the response. If so, execute it and return the result.

    • return mixed
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only