Module: Workers::StatusBroadcastable::Overrides
- Included in:
- Workers::StatusBroadcastable
- Defined in:
- app/concerns/workers/status_broadcastable.rb
Overview
Overrides for at/total/store that must be PREPENDED so they sit above
Sidekiq::Status::Worker in the MRO (StatusBroadcastable itself is included
after Sidekiq::Status::Worker, so plain instance methods on it would lose
the method-lookup race).
Instance Method Summary collapse
- #at(step, message = nil) ⇒ Object
-
#store(hash = {}) ⇒ Object
Called when job completes or stores flash messages (redirect_to, etc.).
- #total(total_steps = nil) ⇒ Object
Instance Method Details
#at(step, message = nil) ⇒ Object
39 40 41 42 43 |
# File 'app/concerns/workers/status_broadcastable.rb', line 39 def at(step, = nil) result = super broadcast_job_status if broadcast_enabled? result end |
#store(hash = {}) ⇒ Object
Called when job completes or stores flash messages (redirect_to, etc.)
52 53 54 55 56 57 58 59 60 |
# File 'app/concerns/workers/status_broadcastable.rb', line 52 def store(hash = {}) result = super if hash.keys.any? { |k| terminal_status_key?(k) } broadcast_job_status(terminal: true) elsif broadcast_enabled? broadcast_job_status end result end |
#total(total_steps = nil) ⇒ Object
45 46 47 48 49 |
# File 'app/concerns/workers/status_broadcastable.rb', line 45 def total(total_steps = nil) result = super broadcast_job_status if broadcast_enabled? result end |