Class: Rukawa::Job
- Inherits:
-
AbstractJob
- Object
- AbstractJob
- Rukawa::Job
- Defined in:
- lib/rukawa/job.rb
Instance Attribute Summary collapse
-
#finished_at ⇒ Object
readonly
Returns the value of attribute finished_at.
-
#in_comings ⇒ Object
Returns the value of attribute in_comings.
-
#out_goings ⇒ Object
Returns the value of attribute out_goings.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Attributes inherited from AbstractJob
Class Method Summary collapse
Instance Method Summary collapse
- #dataflow ⇒ Object
-
#initialize(parent_job_net, variables) ⇒ Job
constructor
A new instance of Job.
- #jobs_as_from ⇒ Object (also: #jobs_as_to)
- #leaf? ⇒ Boolean
- #root? ⇒ Boolean
- #run ⇒ Object
- #set_state(name) ⇒ Object
- #to_dot_def ⇒ Object
Methods inherited from AbstractJob
add_skip_rule, description, #elapsed_time_from, #formatted_elapsed_time_from, #inspect, #name, set_description, #skip?
Constructor Details
#initialize(parent_job_net, variables) ⇒ Job
Returns a new instance of Job.
29 30 31 32 33 34 35 36 37 |
# File 'lib/rukawa/job.rb', line 29 def initialize(parent_job_net, variables) @parent_job_net = parent_job_net @variables = variables @in_comings = Set.new @out_goings = Set.new @retry_count = 0 @retry_wait = 1 set_state(:waiting) end |
Instance Attribute Details
#finished_at ⇒ Object (readonly)
Returns the value of attribute finished_at.
10 11 12 |
# File 'lib/rukawa/job.rb', line 10 def finished_at @finished_at end |
#in_comings ⇒ Object
Returns the value of attribute in_comings.
9 10 11 |
# File 'lib/rukawa/job.rb', line 9 def in_comings @in_comings end |
#out_goings ⇒ Object
Returns the value of attribute out_goings.
9 10 11 |
# File 'lib/rukawa/job.rb', line 9 def out_goings @out_goings end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
10 11 12 |
# File 'lib/rukawa/job.rb', line 10 def started_at @started_at end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
10 11 12 |
# File 'lib/rukawa/job.rb', line 10 def state @state end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
10 11 12 |
# File 'lib/rukawa/job.rb', line 10 def variables @variables end |
Class Method Details
.set_dependency_type(name) ⇒ Object
24 25 26 |
# File 'lib/rukawa/job.rb', line 24 def set_dependency_type(name) self.dependency_type = Rukawa::Dependency.get(name) end |
.set_retryable(limit: 8, type: nil, wait: nil) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rukawa/job.rb', line 17 def set_retryable(limit: 8, type: nil, wait: nil) self.retryable = true self.retry_limit = limit self.retry_exception_type = type self.retry_wait = wait end |
Instance Method Details
#dataflow ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/rukawa/job.rb', line 51 def dataflow return @dataflow if @dataflow return @dataflow = bypass_dataflow if @state.bypassed? @dataflow = Concurrent.dataflow_with(Rukawa.executor, *depend_dataflows) do |*results| do_run(*results) @state end end |
#jobs_as_from ⇒ Object Also known as: jobs_as_to
86 87 88 |
# File 'lib/rukawa/job.rb', line 86 def jobs_as_from [self] end |
#leaf? ⇒ Boolean
47 48 49 |
# File 'lib/rukawa/job.rb', line 47 def leaf? out_goings.select { |edge| edge.cluster == @parent_job_net }.empty? end |
#root? ⇒ Boolean
43 44 45 |
# File 'lib/rukawa/job.rb', line 43 def root? in_comings.select { |edge| edge.cluster == @parent_job_net }.empty? end |
#run ⇒ Object
61 62 |
# File 'lib/rukawa/job.rb', line 61 def run end |