class

Croupier::Task

Inherits YAML::Serializable::Strict / YAML::Serializable / Reference / Object

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

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
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)
Source
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. Overload for convenience.

Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
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)
Source
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)
Source

Instance methods

always_run=(always_run : Bool)
Source
always_run?
Source
id=(id : String)
Source
inputs
Source
inputs=(inputs : Set(String))
Source
keys

Under what keys should this task be registered with TaskManager

Source
mark_dependency_fresh(input : String)

Mark that a dependency (input) is known to be unchanged. Recomputes staleness considering ALL inputs together (thread-safe).

Source
master_task=(master_task : Bool)
Source
master_task?
Source
merge(other : Task)

Merge two tasks.

inputs and outputs are joined procs of the second task are added to the 1st

Source
mergeable=(mergeable : Bool)
Source
mergeable?
Source
mutex
Source
mutex=(mutex : String | Nil)
Source
no_save=(no_save : Bool)
Source
no_save?
Source
outputs
Source
outputs=(outputs : Array(String))
Source
outputs_changed=(outputs_changed : Bool)
Source
outputs_changed?
Source
procs
Source
procs=(procs : Array(TaskProc))
Source
ready?(run_all = false)

A task is ready if it is stale and not waiting for anything

Source
run

Executes the proc for the task

Source
stale
Source
stale=(value : Bool | Nil)

Set staleness (updates both property and atomic for thread safety)

Source
stale?
Source
subtask_ids
Source
subtask_ids=(subtask_ids : Set(String))
Source
to_s(io)
Source
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.

Source