Class: KubeMQ::CQ::CommandResponse
- Inherits:
-
Object
- Object
- KubeMQ::CQ::CommandResponse
- Defined in:
- lib/kubemq/cq/command_response.rb
Overview
Response returned by KubeMQ::CQClient#send_command after a subscriber processes the command.
Check #executed to confirm the command was handled successfully.
If executed is false, inspect #error for the reason.
Instance Attribute Summary collapse
-
#client_id ⇒ String
readonly
The responder's client identifier.
-
#error ⇒ String?
readonly
Error description if execution failed.
-
#executed ⇒ Boolean
readonly
trueif the command was executed successfully. -
#request_id ⇒ String
readonly
The original command request identifier.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#timestamp ⇒ Integer
readonly
Broker-assigned response timestamp (Unix nanoseconds).
Instance Method Summary collapse
-
#initialize(client_id:, request_id:, executed:, error: nil, timestamp: 0, tags: nil) ⇒ CommandResponse
constructor
A new instance of CommandResponse.
Constructor Details
#initialize(client_id:, request_id:, executed:, error: nil, timestamp: 0, tags: nil) ⇒ CommandResponse
Returns a new instance of CommandResponse.
34 35 36 37 38 39 40 41 |
# File 'lib/kubemq/cq/command_response.rb', line 34 def initialize(client_id:, request_id:, executed:, error: nil, timestamp: 0, tags: nil) @client_id = client_id @request_id = request_id @executed = executed @error = error = = || {} end |
Instance Attribute Details
#client_id ⇒ String (readonly)
Returns the responder's client identifier.
26 27 28 |
# File 'lib/kubemq/cq/command_response.rb', line 26 def client_id @client_id end |
#error ⇒ String? (readonly)
Returns error description if execution failed.
26 |
# File 'lib/kubemq/cq/command_response.rb', line 26 attr_reader :client_id, :request_id, :executed, :error, :timestamp, :tags |
#executed ⇒ Boolean (readonly)
Returns true if the command was executed successfully.
26 |
# File 'lib/kubemq/cq/command_response.rb', line 26 attr_reader :client_id, :request_id, :executed, :error, :timestamp, :tags |
#request_id ⇒ String (readonly)
Returns the original command request identifier.
26 |
# File 'lib/kubemq/cq/command_response.rb', line 26 attr_reader :client_id, :request_id, :executed, :error, :timestamp, :tags |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
26 |
# File 'lib/kubemq/cq/command_response.rb', line 26 attr_reader :client_id, :request_id, :executed, :error, :timestamp, :tags |
#timestamp ⇒ Integer (readonly)
Returns broker-assigned response timestamp (Unix nanoseconds).
26 |
# File 'lib/kubemq/cq/command_response.rb', line 26 attr_reader :client_id, :request_id, :executed, :error, :timestamp, :tags |