class BatchKit::Task::Run
Captures details of an execution of a task.
Attributes
job_run[R]
@return [Job::Run] The job run that this task is running under.
task_run_id[RW]
@return [Fixnum] An integer identifier that uniquely identifies
this task run.
Public Class Methods
new(task_def, job_object, job_run, *run_args)
click to toggle source
Create a new task run.
@param task_def [Task::Definition] The Task::Definition
to which this
run relates.
@param job_object [Object] The job object instance from which the
task is being executed.
@param job_run
[Job::Run] The job run to which this task run belongs. @param run_args [Array<Object>] An array of the argument values
passed to the task method.
Calls superclass method
BatchKit::Runnable::new
# File lib/batch-kit/framework/task_run.rb, line 27 def initialize(task_def, job_object, job_run, *run_args) raise ArgumentError, "task_def not a Task::Definition" unless task_def.is_a?(Task::Definition) raise ArgumentError, "job_run not a Job::Run" unless job_run.is_a?(Job::Run) @job_run = job_run @job_run << self super(task_def, job_object, run_args) end
Public Instance Methods
persist?()
click to toggle source
@return [Boolean] True if this task run should be persisted in any
persistence layer.
# File lib/batch-kit/framework/task_run.rb, line 38 def persist? !definition.job.do_not_track end
to_s()
click to toggle source
@return [String] A short representation of this Task::Run
.
# File lib/batch-kit/framework/task_run.rb, line 44 def to_s "<BatchKit::Task::Run label='#{label}'>" end