Sha256: a7227f562b023ababd8d63eb3e4ba994a19b5de2bd8c38514688a0b47279c863

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require 'hashdiff'

module Legion
  module Extensions
    module Actors
      module Base
        include Legion::Extensions::Helpers::Lex

        def runner
          # runner_class:, function:, task_id: nil, args: nil, check_subtask: true, generate_task: true, parent_id: nil, master_id: nil, **opts
          Legion::Runner.run(runner_class: runner_class, function: function, check_subtask: check_subtask, generate_task: generate_task)
        rescue StandardError => e
          Legion::Logging.error e.message
          Legion::Logging.error e.backtrace
        end

        def manual
          # Legion::Runner.run(runner_class: runner_class, function: runner_function, check_subtask: false, generate_task: false, args: args)
          runner_class.send(runner_function, args)
        rescue StandardError => e
          Legion::Logging.error e.message
          Legion::Logging.error e.backtrace
        end

        def function
          nil
        end

        def use_runner?
          true
        end

        def args
          {}
        end

        def check_subtask?
          true
        end

        def generate_task?
          false
        end

        def enabled?
          true
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legionio-0.2.0 lib/legion/extensions/actors/base.rb