Class: RSMP::CommandResponseCollector
- Inherits:
-
StateCollector
- Object
- Collector
- StateCollector
- RSMP::CommandResponseCollector
- Defined in:
- lib/rsmp/collect/command_response_collector.rb
Overview
Class for waiting for specific command responses
Instance Attribute Summary
Attributes inherited from StateCollector
Attributes inherited from Collector
#condition, #error, #m_id, #messages, #status, #task
Instance Method Summary collapse
- #build_matcher(want) ⇒ Object
-
#get_items(message) ⇒ Object
Get items, in our case the return values.
-
#initialize(proxy, want, options = {}) ⇒ CommandResponseCollector
constructor
A new instance of CommandResponseCollector.
Methods inherited from StateCollector
#describe, #describe_matcher, #describe_progress, #done?, #keep, #log_complete, #matcher_got_hash, #matcher_result, #matcher_status, #matcher_want_hash, #messages, #perform_match, #progress, #progress_hash, #reached, #summary
Methods inherited from Collector
#acceptable?, #cancel, #cancelled?, #collect, #collect!, #collecting?, #complete, #describe, #describe_matcher, #describe_num_and_type, #describe_progress, #describe_types, #do_stop, #done?, #identifier, #incomplete, #ingoing?, #inspect, #keep, #log_complete, #log_incomplete, #log_start, #make_title, #ok!, #ok?, #outgoing?, #perform_match, #ready?, #receive, #receive_disconnect, #receive_error, #receive_schema_error, #reject_not_ack, #reset, #start, #timeout?, #use_task, #wait, #wait!
Methods included from Receiver
#accept_message?, #handle_message, #initialize_receiver, #receive, #receive_error, #reject_message?, #start_receiving, #stop_receiving
Methods included from Inspect
Constructor Details
#initialize(proxy, want, options = {}) ⇒ CommandResponseCollector
Returns a new instance of CommandResponseCollector.
4 5 6 7 8 9 |
# File 'lib/rsmp/collect/command_response_collector.rb', line 4 def initialize proxy, want, ={} super proxy, want, .merge( filter: RSMP::Filter.new(ingoing: true, outgoing: false, type: 'CommandResponse'), title:'command response' ) end |
Instance Method Details
#build_matcher(want) ⇒ Object
11 12 13 |
# File 'lib/rsmp/collect/command_response_collector.rb', line 11 def build_matcher want CommandMatcher.new want end |
#get_items(message) ⇒ Object
Get items, in our case the return values
16 17 18 |
# File 'lib/rsmp/collect/command_response_collector.rb', line 16 def get_items .attributes['rvs'] || [] end |