Class: Poller
- Inherits:
-
Object
- Object
- Poller
- Defined in:
- lib/poller.rb
Instance Method Summary collapse
-
#initialize(waiter, continuer, action) ⇒ Poller
constructor
A new instance of Poller.
- #start ⇒ Object
Constructor Details
#initialize(waiter, continuer, action) ⇒ Poller
Returns a new instance of Poller.
3 4 5 6 7 |
# File 'lib/poller.rb', line 3 def initialize(waiter, continuer, action) @waiter = waiter @continuer = continuer @action = action end |
Instance Method Details
#start ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/poller.rb', line 9 def start ran = false while @continuer.continue? @waiter.wait unless ran ran = @action.run end end |