Class: ZMachine::HashedWheelTimeout
- Inherits:
-
Object
- Object
- ZMachine::HashedWheelTimeout
- Defined in:
- lib/zmachine/hashed_wheel.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#deadline ⇒ Object
readonly
Returns the value of attribute deadline.
Instance Method Summary collapse
- #cancel ⇒ Object
- #canceled? ⇒ Boolean
-
#initialize(deadline, &block) ⇒ HashedWheelTimeout
constructor
A new instance of HashedWheelTimeout.
Constructor Details
#initialize(deadline, &block) ⇒ HashedWheelTimeout
Returns a new instance of HashedWheelTimeout.
9 10 11 12 13 |
# File 'lib/zmachine/hashed_wheel.rb', line 9 def initialize(deadline, &block) @deadline = deadline @callback = block @canceled = false end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
7 8 9 |
# File 'lib/zmachine/hashed_wheel.rb', line 7 def callback @callback end |
#deadline ⇒ Object (readonly)
Returns the value of attribute deadline.
6 7 8 |
# File 'lib/zmachine/hashed_wheel.rb', line 6 def deadline @deadline end |
Instance Method Details
#cancel ⇒ Object
15 16 17 |
# File 'lib/zmachine/hashed_wheel.rb', line 15 def cancel @canceled = true end |
#canceled? ⇒ Boolean
19 20 21 |
# File 'lib/zmachine/hashed_wheel.rb', line 19 def canceled? @canceled end |