Class: Rack::Timeout::Scheduler::RunEvent
- Inherits:
-
Struct
- Object
- Struct
- Rack::Timeout::Scheduler::RunEvent
- Defined in:
- lib/rack/timeout/support/scheduler.rb
Overview
stores a proc to run later, and the time it should run at
Direct Known Subclasses
Instance Attribute Summary collapse
-
#monotime ⇒ Object
Returns the value of attribute monotime.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
Instance Attribute Details
#monotime ⇒ Object
Returns the value of attribute monotime
23 24 25 |
# File 'lib/rack/timeout/support/scheduler.rb', line 23 def monotime @monotime end |
#proc ⇒ Object
Returns the value of attribute proc
23 24 25 |
# File 'lib/rack/timeout/support/scheduler.rb', line 23 def proc @proc end |
Instance Method Details
#cancel! ⇒ Object
24 25 26 |
# File 'lib/rack/timeout/support/scheduler.rb', line 24 def cancel! @cancelled = true end |
#cancelled? ⇒ Boolean
28 29 30 |
# File 'lib/rack/timeout/support/scheduler.rb', line 28 def cancelled? !!@cancelled end |
#run! ⇒ Object
32 33 34 35 |
# File 'lib/rack/timeout/support/scheduler.rb', line 32 def run! return if @cancelled proc.call(self) end |