Class: Zenaton::Interfaces::Task Abstract
- Defined in:
- lib/zenaton/interfaces/task.rb
Overview
This class is abstract.
Subclass and override #handle to define your custom tasks
Direct Known Subclasses
Instance Method Summary collapse
-
#context ⇒ Zenaton::Contexts::Task
The task execution context.
-
#handle ⇒ Object
Child classes should implement the handle method.
-
#on_error_retry_delay(_exception) ⇒ Integer, ...
(Optional) Implement this method for automatic retrial of task in case of failures.
Instance Method Details
#context ⇒ Zenaton::Contexts::Task
Returns the task execution context.
27 28 29 |
# File 'lib/zenaton/interfaces/task.rb', line 27 def context @context || Contexts::Task.new end |
#handle ⇒ Object
Child classes should implement the handle method
11 12 13 14 |
# File 'lib/zenaton/interfaces/task.rb', line 11 def handle raise NotImplemented, "Your workflow does not implement the `#handle' method" end |
#on_error_retry_delay(_exception) ⇒ Integer, ...
(Optional) Implement this method for automatic retrial of task in case of failures.
22 23 24 |
# File 'lib/zenaton/interfaces/task.rb', line 22 def on_error_retry_delay(_exception) nil end |