class
Croupier::Task
- Croupier::Task
- Reference
- Object
Overview
A Task is an object that may generate output
It has a Proc which is executed when the task is run
It can have zero or more inputs
It has zero or more outputs
Tasks are connected by dependencies, where one task's output is another's input
Included Modules
- YAML::Serializable
- YAML::Serializable::Strict
Defined in:
task.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(outputs : Array(String) = [] of String, inputs : Array(String) = [] of String, no_save : Bool = false, id : String | Nil = nil, always_run : Bool = false, mergeable : Bool = true, mutex : String | Nil = nil, master_task : Bool = false, &block : TaskProc)
- .new(outputs : Array(String) = [] of String, inputs : Array(String) = [] of String, proc : TaskProc | Nil = nil, no_save : Bool = false, id : String | Nil = nil, always_run : Bool = false, mergeable : Bool = true, master_task : Bool = false)
- .new(output : String | Nil = nil, inputs : Array(String) = [] of String, no_save : Bool = false, id : String | Nil = nil, always_run : Bool = false, mergeable : Bool = true, master_task : Bool = false, &block : TaskProc)
-
.new(output : String | Nil = nil, inputs : Array(String) = [] of String, proc : TaskProc | Nil = nil, no_save : Bool = false, id : String | Nil = nil, always_run : Bool = false, mergeable : Bool = true, master_task : Bool = false)
Create a task with zero or one outputs.
Instance Method Summary
- #always_run=(always_run : Bool)
- #always_run? : Bool
- #id : String
- #id=(id : String)
- #inputs : Set(String)
- #inputs=(inputs : Set(String))
-
#keys
Under what keys should this task be registered with TaskManager
-
#mark_dependency_fresh(input : String)
Mark that a dependency (input) is known to be unchanged.
- #master_task=(master_task : Bool)
- #master_task? : Bool
-
#merge(other : Task)
Merge two tasks.
- #mergeable=(mergeable : Bool)
- #mergeable? : Bool
- #mutex : String | Nil
- #mutex=(mutex : String | Nil)
- #no_save=(no_save : Bool)
- #no_save? : Bool
- #outputs : Array(String)
- #outputs=(outputs : Array(String))
- #outputs_changed=(outputs_changed : Bool)
- #outputs_changed? : Bool
- #procs : Array(TaskProc)
- #procs=(procs : Array(TaskProc))
-
#ready?(run_all = false)
A task is ready if it is stale and not waiting for anything
-
#run
Executes the proc for the task
- #stale : Bool | Nil
-
#stale=(value : Bool | Nil)
Set staleness (updates both property and atomic for thread safety)
- #stale?
- #subtask_ids : Set(String)
- #subtask_ids=(subtask_ids : Set(String))
- #to_s(io)
-
#waiting_for
For inputs that are tasks, we check if they are stale For inputs that are not tasks, they should exist as files If any inputs don't fit those criteria, they are being waited for.
Constructor Detail
Create a task with zero or one outputs. Overload for convenience.
Instance Method Detail
Mark that a dependency (input) is known to be unchanged. Recomputes staleness considering ALL inputs together (thread-safe).
Merge two tasks.
inputs and outputs are joined procs of the second task are added to the 1st
For inputs that are tasks, we check if they are stale For inputs that are not tasks, they should exist as files If any inputs don't fit those criteria, they are being waited for.