Class: RSMP::AckCollector
- Defined in:
- lib/rsmp/collect/ack_collector.rb
Overview
Class for waiting for a message acknowledgement
Instance Attribute Summary
Attributes inherited from Collector
#condition, #error, #messages, #status, #task
Instance Method Summary collapse
-
#initialize(proxy, options = {}) ⇒ AckCollector
constructor
A new instance of AckCollector.
-
#type_match?(message) ⇒ Boolean
Check if we the MessageAck related to initiating request, identified by @m_id.
Methods inherited from Collector
#cancel, #cancelled?, #collect, #collect!, #collecting?, #complete, #describe, #describe_num_and_type, #describe_progress, #describe_query, #describe_types, #do_stop, #done?, #identifier, #incomplete, #ingoing?, #inspect, #keep, #log_complete, #log_incomplete, #log_start, #notify, #notify_disconnect, #notify_error, #notify_schema_error, #ok!, #ok?, #outgoing?, #perform_match, #ready?, #reject_not_ack, #reset, #start, #timeout?, #use_task, #wait, #wait!
Methods inherited from Listener
#change_notifier, #notify, #notify_error
Methods included from Inspect
Constructor Details
#initialize(proxy, options = {}) ⇒ AckCollector
Returns a new instance of AckCollector.
4 5 6 7 8 |
# File 'lib/rsmp/collect/ack_collector.rb', line 4 def initialize proxy, ={} raise ArgumentError.new("m_id must be provided") unless [:m_id] required = { type: 'MessageAck', num: 1, title: 'message acknowledgement' } super proxy, .merge(required) end |
Instance Method Details
#type_match?(message) ⇒ Boolean
Check if we the MessageAck related to initiating request, identified by @m_id.
11 12 13 14 |
# File 'lib/rsmp/collect/ack_collector.rb', line 11 def type_match? return false if super() == false return .attribute('oMId') == @options[:m_id] end |