lib/trailblazer/activity/task_wrap/runner.rb in trailblazer-activity-0.10.1 vs lib/trailblazer/activity/task_wrap/runner.rb in trailblazer-activity-0.11.0

- old
+ new

@@ -11,11 +11,11 @@ # @interface Runner def self.call(task, args, circuit_options) wrap_ctx = { task: task } # this pipeline is "wrapped around" the actual `task`. - task_wrap_pipeline = merge_static_with_runtime(task, circuit_options) || raise + task_wrap_pipeline = merge_static_with_runtime(task, **circuit_options) || raise # We save all original args passed into this Runner.call, because we want to return them later after this wrap # is finished. original_args = [ args, circuit_options ] @@ -26,18 +26,17 @@ # return all original_args for the next "real" task in the circuit (this includes circuit_options). return wrap_ctx[:return_signal], wrap_ctx[:return_args] end - private # Compute the task's wrap by applying alterations both static and from runtime. # # NOTE: this is for performance reasons: we could have only one hash containing everything but that'd mean # unnecessary computations at `call`-time since steps might not even be executed. # TODO: make this faster. - def self.merge_static_with_runtime(task, wrap_runtime:, **circuit_options) - static_wrap = TaskWrap.wrap_static_for(task, circuit_options) # find static wrap for this specific task [, or default wrap activity]. + private_class_method def self.merge_static_with_runtime(task, wrap_runtime:, **circuit_options) + static_wrap = TaskWrap.wrap_static_for(task, **circuit_options) # find static wrap for this specific task [, or default wrap activity]. # Apply runtime alterations. # Grab the additional wirings for the particular `task` from `wrap_runtime`. (dynamic_wrap = wrap_runtime[task]) ? dynamic_wrap.(static_wrap) : static_wrap end