Class: Pushr::Daemon::FeedbackHandler
- Inherits:
-
Object
- Object
- Pushr::Daemon::FeedbackHandler
- Defined in:
- lib/pushr/daemon/feedback_handler.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#processor ⇒ Object
readonly
Returns the value of attribute processor.
-
#processor_path ⇒ Object
readonly
Returns the value of attribute processor_path.
Instance Method Summary collapse
-
#initialize(processor_path) ⇒ FeedbackHandler
constructor
A new instance of FeedbackHandler.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(processor_path) ⇒ FeedbackHandler
Returns a new instance of FeedbackHandler.
6 7 8 9 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 6 def initialize(processor_path) @name = 'FeedbackHandler' @processor_path = processor_path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 4 def name @name end |
#processor ⇒ Object (readonly)
Returns the value of attribute processor.
4 5 6 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 4 def processor @processor end |
#processor_path ⇒ Object (readonly)
Returns the value of attribute processor_path.
4 5 6 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 4 def processor_path @processor_path end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 11 def start return unless @processor_path require "#{Dir.pwd}/#{@processor_path}" @processor = Pushr::FeedbackProcessor.new Thread.new do loop do handle_next break if @stop end end end |
#stop ⇒ Object
24 25 26 |
# File 'lib/pushr/daemon/feedback_handler.rb', line 24 def stop @stop = true end |