Class: Cloudtasker::UniqueJob::ConflictStrategy::BaseStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb

Overview

Base behaviour for conflict strategies

Direct Known Subclasses

Raise, Reject, Reschedule

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ BaseStrategy

Build a new instance of the class.

Parameters:



15
16
17
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 15

def initialize(job)
  @job = job
end

Instance Attribute Details

#jobObject (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_executeObject

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_scheduleObject

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