Class: KubeMQ::CQ::QueryReceived
- Inherits:
-
Object
- Object
- KubeMQ::CQ::QueryReceived
- Defined in:
- lib/kubemq/cq/query_received.rb
Overview
A query received by a subscriber via KubeMQ::CQClient#subscribe_to_queries.
After processing, use the #reply_channel and #id to construct a QueryResponseMessage and send it back via KubeMQ::CQClient#send_response.
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Query payload (binary).
-
#channel ⇒ String
readonly
The channel the query was sent to.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#id ⇒ String
readonly
Request identifier (use as
request_idin the response). -
#metadata ⇒ String
readonly
Query metadata.
-
#reply_channel ⇒ String
readonly
Channel to send the response back on.
-
#tags ⇒ Hash{String => String}
readonly
User-defined key-value tags.
-
#timeout ⇒ Integer
readonly
Original timeout from the sender (milliseconds).
Instance Method Summary collapse
-
#initialize(id:, channel:, metadata:, body:, reply_channel:, tags:, timeout: 0, client_id: nil, **_) ⇒ QueryReceived
constructor
A new instance of QueryReceived.
Constructor Details
#initialize(id:, channel:, metadata:, body:, reply_channel:, tags:, timeout: 0, client_id: nil, **_) ⇒ QueryReceived
Returns a new instance of QueryReceived.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/kubemq/cq/query_received.rb', line 40 def initialize(id:, channel:, metadata:, body:, reply_channel:, tags:, timeout: 0, client_id: nil, **_) @id = id @channel = channel = @body = body @reply_channel = reply_channel = || {} @timeout = timeout @client_id = client_id end |
Instance Attribute Details
#body ⇒ String (readonly)
Returns query payload (binary).
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#channel ⇒ String (readonly)
Returns the channel the query was sent to.
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#id ⇒ String (readonly)
Returns request identifier (use as request_id in the response).
30 31 32 |
# File 'lib/kubemq/cq/query_received.rb', line 30 def id @id end |
#metadata ⇒ String (readonly)
Returns query metadata.
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#reply_channel ⇒ String (readonly)
Returns channel to send the response back on.
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#tags ⇒ Hash{String => String} (readonly)
Returns user-defined key-value tags.
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |
#timeout ⇒ Integer (readonly)
Returns original timeout from the sender (milliseconds).
30 |
# File 'lib/kubemq/cq/query_received.rb', line 30 attr_reader :id, :channel, :metadata, :body, :reply_channel, :tags, :timeout, :client_id |