Class: Enginevib::Scheduler
- Inherits:
-
Object
- Object
- Enginevib::Scheduler
- Defined in:
- lib/enginevib/scheduler.rb
Overview
Defines the scheduler class
Instance Attribute Summary collapse
-
#averager ⇒ Object
Returns the value of attribute averager.
-
#block ⇒ Object
Returns the value of attribute block.
-
#deadline ⇒ Object
Returns the value of attribute deadline.
-
#inop ⇒ Object
Returns the value of attribute inop.
-
#stats ⇒ Object
Returns the value of attribute stats.
-
#tolerance ⇒ Object
Returns the value of attribute tolerance.
Instance Method Summary collapse
-
#initialize(deadline, tolerance, &block) ⇒ Scheduler
constructor
A new instance of Scheduler.
- #start ⇒ Object
- #tick ⇒ Object
Constructor Details
Instance Attribute Details
#averager ⇒ Object
Returns the value of attribute averager.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def averager @averager end |
#block ⇒ Object
Returns the value of attribute block.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def block @block end |
#deadline ⇒ Object
Returns the value of attribute deadline.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def deadline @deadline end |
#inop ⇒ Object
Returns the value of attribute inop.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def inop @inop end |
#stats ⇒ Object
Returns the value of attribute stats.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def stats @stats end |
#tolerance ⇒ Object
Returns the value of attribute tolerance.
8 9 10 |
# File 'lib/enginevib/scheduler.rb', line 8 def tolerance @tolerance end |
Instance Method Details
#start ⇒ Object
18 19 20 |
# File 'lib/enginevib/scheduler.rb', line 18 def start preempt_rt { loop { tick } } end |
#tick ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/enginevib/scheduler.rb', line 22 def tick execution_time = execute_block actual_wait_time = wait_for_next_tick(execution_time) measure_time = measure_execution(execution_time, actual_wait_time) verify_measure_time(execution_time, actual_wait_time, measure_time) end |