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
Attributes included from Logging
Instance Method Summary collapse
-
#acceptable?(message) ⇒ Boolean
Check if we the MessageAck related to initiating request, identified by @m_id.
-
#initialize(proxy, options = {}) ⇒ AckCollector
constructor
A new instance of AckCollector.
Methods inherited from Collector
#active?, #build_collection, #cancel, #collect, #collect!, #complete, #crash, #describe, #done?, #fail, #incomplete, #inspect, #keep, #make_title, #perform_match?, #receive, #receive_connection_ended, #receive_event, #receive_invalid_message, #reject_not_ack?, #reset, #start, #stop, #wait, #wait!
Methods included from Logging
#author, #initialize_logging, #log
Methods included from Collector::Reporting
#describe_matcher, #describe_num_and_type, #describe_progress, #describe_types, #identifier
Methods included from Receiver
#accept_message?, #handle_message, #initialize_receiver, #inspect, #receive, #receive_event, #reject_message?, #start_receiving, #stop_receiving
Constructor Details
#initialize(proxy, options = {}) ⇒ AckCollector
Returns a new instance of AckCollector.
4 5 6 7 8 9 10 11 12 |
# File 'lib/rsmp/collect/ack_collector.rb', line 4 def initialize(proxy, = {}) raise ArgumentError, 'm_id must be provided' unless [:m_id] super(proxy, .merge( filter: RSMP::Filter.new(ingoing: true, outgoing: false, type: 'MessageAck'), num: 1, title: 'message acknowledgement' )) end |
Instance Method Details
#acceptable?(message) ⇒ Boolean
Check if we the MessageAck related to initiating request, identified by @m_id.
15 16 17 |
# File 'lib/rsmp/collect/ack_collector.rb', line 15 def acceptable?() super && .attribute('oMId') == @m_id end |