Class: Google::Cloud::PubSub::AcknowledgeResult

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/pubsub/acknowledge_result.rb

Overview

The result of a ack/nack/modack on messages.

When the operation was successful the result will be marked #succeeded?. Otherwise, the result will be marked #failed? and the error raised will be availabe on #error.

Constant Summary collapse

SUCCESS =

The constants below represents the status of ack/modack operations. Indicates successful ack/modack

1
PERMISSION_DENIED =

Indicates occurence of permenant permission denied error

2
FAILED_PRECONDITION =

Indicates occurence of permenant failed precondition error

3
INVALID_ACK_ID =

Indicates occurence of permenant permission denied error

4
OTHER =

Indicates occurence of permenant uncatogorised error

5

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorGoogle::Cloud::Error (readonly)

Returns Error object of ack/modack operation.

Returns:

  • (Google::Cloud::Error)

    Error object of ack/modack operation



50
51
52
# File 'lib/google/cloud/pubsub/acknowledge_result.rb', line 50

def error
  @error
end

#statusNumeric (readonly)

Returns Status of the ack/modack operation.

Returns:

  • (Numeric)

    Status of the ack/modack operation.



54
55
56
# File 'lib/google/cloud/pubsub/acknowledge_result.rb', line 54

def status
  @status
end

Instance Method Details

#failed?Boolean

Returns Whether the operation failed.

Returns:

  • (Boolean)

    Whether the operation failed.



71
72
73
# File 'lib/google/cloud/pubsub/acknowledge_result.rb', line 71

def failed?
  !succeeded?
end

#succeeded?Boolean

Returns Whether the operation was successful.

Returns:

  • (Boolean)

    Whether the operation was successful.



65
66
67
# File 'lib/google/cloud/pubsub/acknowledge_result.rb', line 65

def succeeded?
  @status == SUCCESS
end