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.



31
32
33
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 31

def on_execute
  true
end

#on_scheduleObject

Handling logic to perform when a conflict occurs while scheduling a job.



23
24
25
# File 'lib/cloudtasker/unique_job/conflict_strategy/base_strategy.rb', line 23

def on_schedule
  true
end