Class: Google::Cloud::PubSub::PublishResult
- Inherits:
-
Object
- Object
- Google::Cloud::PubSub::PublishResult
- Defined in:
- lib/google/cloud/pubsub/publish_result.rb
Overview
The result of a publish operation. The message object is available on #message and will have #message_id assigned by the API.
When the publish 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.
Instance Method Summary collapse
-
#attributes ⇒ Object
The message's attributes.
-
#data ⇒ Object
The message's data.
-
#error ⇒ Object
The error that was raised when published, if any.
-
#failed? ⇒ Boolean
Whether the publish request failed.
-
#message ⇒ Object
(also: #msg)
The message.
-
#message_id ⇒ Object
(also: #msg_id)
The ID of the message, assigned by the server at publication time.
-
#published_at ⇒ Object
(also: #publish_time)
The time at which the message was published.
-
#succeeded? ⇒ Boolean
Whether the publish request was successful.
Instance Method Details
#attributes ⇒ Object
The message's attributes.
50 51 52 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 50 def attributes .attributes end |
#data ⇒ Object
The message's data.
44 45 46 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 44 def data .data end |
#error ⇒ Object
The error that was raised when published, if any.
71 72 73 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 71 def error @error end |
#failed? ⇒ Boolean
Whether the publish request failed.
82 83 84 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 82 def failed? !succeeded? end |
#message ⇒ Object Also known as: msg
The message.
37 38 39 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 37 def @message end |
#message_id ⇒ Object Also known as: msg_id
The ID of the message, assigned by the server at publication time. Guaranteed to be unique within the topic.
57 58 59 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 57 def . end |
#published_at ⇒ Object Also known as: publish_time
The time at which the message was published.
64 65 66 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 64 def published_at .published_at end |
#succeeded? ⇒ Boolean
Whether the publish request was successful.
77 78 79 |
# File 'lib/google/cloud/pubsub/publish_result.rb', line 77 def succeeded? error.nil? end |