Class: Allora::Backend
- Inherits:
-
Object
- Object
- Allora::Backend
- Defined in:
- lib/allora/backend.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Backend
constructor
Initialize the backend with the given options Hash.
-
#reschedule(jobs) ⇒ Hash
Reschedules jobs in the given Hash and returns those that should run now.
Constructor Details
#initialize(opts = {}) ⇒ Backend
Initialize the backend with the given options Hash.
32 33 34 |
# File 'lib/allora/backend.rb', line 32 def initialize(opts = {}) = opts end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
26 27 28 |
# File 'lib/allora/backend.rb', line 26 def end |
Instance Method Details
#reschedule(jobs) ⇒ Hash
Reschedules jobs in the given Hash and returns those that should run now.
Subclasses should take an approach that tracks the run time information and updates it in a way that avoids race conditions. The job should not be run until it can be guaranteed that it has been rescheduled for a future time and no other scheduler process executed the job first.
48 49 50 |
# File 'lib/allora/backend.rb', line 48 def reschedule(jobs) raise NotImplementedError, "Abstract method #reschedule must be implemented by subclass" end |