Class: SuperPoller::Poller
- Inherits:
-
Object
- Object
- SuperPoller::Poller
- Defined in:
- lib/super_poller/poller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(queue, message_handler, sleep_time = 1) ⇒ Poller
constructor
A new instance of Poller.
- #poll ⇒ Object
- #start! ⇒ Object
Constructor Details
#initialize(queue, message_handler, sleep_time = 1) ⇒ Poller
Returns a new instance of Poller.
2 3 4 |
# File 'lib/super_poller/poller.rb', line 2 def initialize(queue, , sleep_time = 1) @message_handler, @queue, @sleep_time = , queue, sleep_time end |
Instance Method Details
#poll ⇒ Object
6 7 8 |
# File 'lib/super_poller/poller.rb', line 6 def poll @message_handler.call() end |
#start! ⇒ Object
10 11 12 |
# File 'lib/super_poller/poller.rb', line 10 def start! poll while true end |