Sha256: f7b69b9fbf076de7ebff61e01294294fe0a3074a028a65c854c4ca07988b8d38

Contents?: true

Size: 827 Bytes

Versions: 9

Compression:

Stored size: 827 Bytes

Contents

class Trailblazer::Activity
  module TaskWrap
    # TaskWrap step that calls the actual wrapped task and passes all `original_args` to it.
    #
    # It writes to wrap_ctx[:return_signal], wrap_ctx[:return_args]
    def self.call_task(wrap_ctx, original_args)
      task = wrap_ctx[:task]

      original_arguments, original_circuit_options = original_args

      # Call the actual task we're wrapping here.
      # puts "~~~~wrap.call: #{task}"
      return_signal, return_args = task.(original_arguments, **original_circuit_options)

      # DISCUSS: do we want original_args here to be passed on, or the "effective" return_args which are different to original_args now?
      wrap_ctx = wrap_ctx.merge( return_signal: return_signal, return_args: return_args )

      return wrap_ctx, original_args
    end
  end # Wrap
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trailblazer-activity-0.15.1 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.15.0 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.14.0 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.14.0.beta2 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.14.0.beta1 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.13.0 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.12.2 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.12.1 lib/trailblazer/activity/task_wrap/call_task.rb
trailblazer-activity-0.12.0 lib/trailblazer/activity/task_wrap/call_task.rb