Class: Zenaton::Interfaces::Task Abstract

Inherits:
Job
  • Object
show all
Defined in:
lib/zenaton/interfaces/task.rb

Overview

This class is abstract.

Subclass and override #handle to define your custom tasks

Direct Known Subclasses

Tasks::Wait

Instance Method Summary collapse

Instance Method Details

#contextZenaton::Contexts::Task



27
28
29
# File 'lib/zenaton/interfaces/task.rb', line 27

def context
  @context || Contexts::Task.new
end

#handleObject

Child classes should implement the handle method

Raises:



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