Class: Broker::Poller
- Inherits:
-
Object
- Object
- Broker::Poller
- Defined in:
- lib/broker/launcher.rb
Instance Method Summary collapse
-
#initialize ⇒ Poller
constructor
A new instance of Poller.
- #start ⇒ Object
- #terminate ⇒ Object
Methods included from Event
Methods included from Utility
#safe_thread, #timestamp, #watcher
Constructor Details
Instance Method Details
#start ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/broker/launcher.rb', line 87 def start @thread ||= safe_thread("poller") do pause_first while !@finished register(@finder.check) wait end end end |
#terminate ⇒ Object
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/broker/launcher.rb', line 76 def terminate @finished = true if @thread t = @thread @thread = nil wait 1 t.value puts "Polling thread terminated" end end |