Class: Rack::Timeout::Scheduler::RepeatEvent
- Defined in:
- lib/rack/timeout/support/scheduler.rb
Instance Attribute Summary
Attributes inherited from RunEvent
Instance Method Summary collapse
-
#initialize(monotime, proc, every) ⇒ RepeatEvent
constructor
A new instance of RepeatEvent.
- #run! ⇒ Object
Methods inherited from RunEvent
Constructor Details
#initialize(monotime, proc, every) ⇒ RepeatEvent
Returns a new instance of RepeatEvent.
43 44 45 46 47 48 |
# File 'lib/rack/timeout/support/scheduler.rb', line 43 def initialize(monotime, proc, every) @start = monotime @every = every @iter = 0 super(monotime, proc) end |
Instance Method Details
#run! ⇒ Object
50 51 52 53 54 |
# File 'lib/rack/timeout/support/scheduler.rb', line 50 def run! super ensure self.monotime = @start + @every * (@iter += 1) until monotime >= Rack::Timeout::MonotonicTime.fsecs end |