Class: RSMP::StatusCollector
- Inherits:
-
StateCollector
- Object
- Collector
- StateCollector
- RSMP::StatusCollector
- Defined in:
- lib/rsmp/collect/status_collector.rb
Overview
Base class for waiting for status updates or responses
Instance Attribute Summary
Attributes inherited from StateCollector
Attributes inherited from Collector
#condition, #error, #m_id, #messages, #status, #task
Attributes included from Logging
Instance Method Summary collapse
- #build_matcher(want) ⇒ Object
-
#get_items(message) ⇒ Object
Get items, in our case status values.
-
#initialize(proxy, want, options = {}) ⇒ StatusCollector
constructor
A new instance of StatusCollector.
Methods inherited from StateCollector
#add_command_result, #add_command_want_to_hash, #add_status_result, #add_status_want_to_hash, #describe, #describe_matcher, #describe_progress, #done?, #handle_match_result, #keep, #log_complete, #log_match_result, #matcher_got_hash, #matcher_result, #matcher_status, #matcher_want_hash, #messages, #perform_match, #progress, #progress_hash, #reached, #summary
Methods inherited from Collector
#acceptable?, #cancel, #collect, #collect!, #complete, #describe, #do_stop, #done?, #incomplete, #inspect, #keep, #make_title, #ok!, #perform_match, #receive, #receive_disconnect, #receive_error, #receive_schema_error, #reject_not_ack, #reset, #start, #use_task, #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 Collector::Status
#cancelled?, #collecting?, #ingoing?, #ok?, #outgoing?, #ready?, #timeout?
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 = {}) ⇒ StatusCollector
Returns a new instance of StatusCollector.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/rsmp/collect/status_collector.rb', line 4 def initialize(proxy, want, = {}) type = [] type << 'StatusUpdate' unless [:updates] == false type << 'StatusResponse' unless [:reponses] == false super(proxy, want, .merge( title: 'status response', filter: RSMP::Filter.new(ingoing: true, outgoing: false, type: type) )) end |
Instance Method Details
#build_matcher(want) ⇒ Object
15 16 17 |
# File 'lib/rsmp/collect/status_collector.rb', line 15 def build_matcher(want) RSMP::StatusMatcher.new want end |
#get_items(message) ⇒ Object
Get items, in our case status values
20 21 22 |
# File 'lib/rsmp/collect/status_collector.rb', line 20 def get_items() .attributes['sS'] || [] end |