Class: Mamiya::Agent::Tasks::Notifyable
- Defined in:
- lib/mamiya/agent/tasks/notifyable.rb
Instance Attribute Summary
Attributes inherited from Abstract
#agent, #error, #logger, #task, #task_queue
Instance Method Summary collapse
Methods inherited from Abstract
#after, #before, #errored, identifier, #initialize, #raise_error?, #run, #task_id
Constructor Details
This class inherits a constructor from Mamiya::Agent::Tasks::Abstract
Instance Method Details
#execute ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mamiya/agent/tasks/notifyable.rb', line 7 def execute agent.trigger('task', action: 'start', task: task, coalesce: false, ) super ensure if error agent.trigger('task', action: 'error', error: error.class.name, task: task, coalesce: false, ) else agent.trigger('task', action: 'finish', task: task, coalesce: false, ) end end |