Class: Workhorse::Performer
- Inherits:
-
Object
- Object
- Workhorse::Performer
- Defined in:
- lib/workhorse/performer.rb
Instance Attribute Summary collapse
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
-
#initialize(db_job_id, worker) ⇒ Performer
constructor
A new instance of Performer.
- #perform ⇒ Object
Constructor Details
Instance Attribute Details
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
3 4 5 |
# File 'lib/workhorse/performer.rb', line 3 def worker @worker end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/workhorse/performer.rb', line 11 def perform begin # rubocop:disable Style/RedundantBegin fail 'Performer can only run once.' if @started @started = true perform! rescue Exception => e Workhorse.on_exception.call(e) end end |