Class: SystemTimer::ThreadTimer
- Inherits:
-
Object
- Object
- SystemTimer::ThreadTimer
- Defined in:
- lib/system_timer/thread_timer.rb
Overview
Timer saving associated thread. This is needed because we trigger timers from a Ruby signal handler and Ruby signals are always delivered to main thread.
Instance Attribute Summary collapse
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
-
#trigger_time ⇒ Object
readonly
Returns the value of attribute trigger_time.
Instance Method Summary collapse
-
#initialize(trigger_time, thread) ⇒ ThreadTimer
constructor
A new instance of ThreadTimer.
- #to_s ⇒ Object
Constructor Details
#initialize(trigger_time, thread) ⇒ ThreadTimer
Returns a new instance of ThreadTimer.
11 12 13 14 |
# File 'lib/system_timer/thread_timer.rb', line 11 def initialize(trigger_time, thread) @trigger_time = trigger_time @thread = thread end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
9 10 11 |
# File 'lib/system_timer/thread_timer.rb', line 9 def thread @thread end |
#trigger_time ⇒ Object (readonly)
Returns the value of attribute trigger_time.
9 10 11 |
# File 'lib/system_timer/thread_timer.rb', line 9 def trigger_time @trigger_time end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/system_timer/thread_timer.rb', line 16 def to_s "<ThreadTimer :time => #{trigger_time}, :thread => #{thread}>" end |