Class: Cloudtasker::UniqueJob::ConflictStrategy::BaseStrategy
- Inherits:
-
Object
- Object
- Cloudtasker::UniqueJob::ConflictStrategy::BaseStrategy
- Defined in:
- lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb
Overview
Base behaviour for conflict strategies
Direct Known Subclasses
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
-
#initialize(job) ⇒ BaseStrategy
constructor
Build a new instance of the class.
-
#on_execute ⇒ Object
Handling logic to perform when a conflict occurs while executing a job.
-
#on_schedule ⇒ Object
Handling logic to perform when a conflict occurs while scheduling a job.
Constructor Details
#initialize(job) ⇒ BaseStrategy
Build a new instance of the class.
15 16 17 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 15 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
8 9 10 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 8 def job @job end |
Instance Method Details
#on_execute ⇒ Object
Handling logic to perform when a conflict occurs while executing a job.
33 34 35 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 33 def on_execute nil end |
#on_schedule ⇒ Object
Handling logic to perform when a conflict occurs while scheduling a job.
We return nil to flag the job as not scheduled
25 26 27 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 25 def on_schedule nil end |