Module: Tasker::TaskHandler

Included in:
ConfiguredTask
Defined in:
lib/tasker/task_handler.rb,
lib/tasker/task_handler/step_group.rb,
lib/tasker/task_handler/class_methods.rb,
lib/tasker/task_handler/instance_methods.rb

Overview

Main module for task handler functionality

TaskHandler provides the core functionality for defining and executing workflows. When included in a class, it adds methods for:

  • Defining step templates with dependencies and configurations
  • Initializing and running tasks with proper error handling
  • Processing steps in sequence or concurrently
  • Managing retries and error recovery

Examples:

Creating a basic task handler

class MyTaskHandler
  include Tasker::TaskHandler

  define_step_templates do |definer|
    definer.define(
      name: 'first_step',
      handler_class: SomeStepHandler
    )
  end
end

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: StepGroup

Class Method Summary collapse

Class Method Details

.included(base) ⇒ void

This method returns an undefined value.

When included, extends the class with ClassMethods and includes InstanceMethods

Parameters:

  • base (Class)

    The class including this module



38
39
40
41
# File 'lib/tasker/task_handler.rb', line 38

def self.included(base)
  base.extend(ClassMethods)
  base.include(InstanceMethods)
end