class Croupier::TaskManagerType

Overview

TaskManager is a singleton that keeps track of all tasks

Defined in:

croupier.cr

Instance Method Summary

Instance Method Detail

def _dependencies(outputs : Array(String)) #

Helper function for dependencies


[View source]
def _run_tasks(outputs, run_all : Bool = false, dry_run : Bool = false, keep_going : Bool = false) #

Internal helper to run tasks serially


[View source]
def _run_tasks_parallel(targets : Array(String) = [] of String, run_all : Bool = false, dry_run : Bool = false, keep_going : Bool = false) #

Internal helper to run tasks concurrently

Whenever a task is ready, launch it in a separate fiber This is only concurrency, not parallelism, but on tests it seems to be faster than running tasks sequentially.


[View source]
def all_inputs #

[View source]
def auto_mode=(auto_mode : Bool) #

If true, it's running in auto mode


[View source]
def auto_mode? : Bool #

If true, it's running in auto mode


[View source]
def auto_run(targets : Array(String) = [] of String) #

[View source]
def auto_stop #

[View source]
def check_dependencies #

Check if all inputs are correct: They should all be either task outputs or existing files


[View source]
def cleanup #

Remove all tasks and everything else (good for tests)


[View source]
def dependencies(outputs : Array(String)) #

Get a task list of what tasks need to be done to produce outputs The list is sorted so it can be executed in order


[View source]
def dependencies(output : String) #

Get a task list of what tasks need to be done to produce output The list is sorted so it can be executed in order Overloaded to accept a single string for convenience


[View source]
def depends_on(input : String) #

[View source]
def depends_on(inputs : Array(String)) #

[View source]
def fast_dirs=(fast_dirs : Bool) #

If true, directories depend on a list of files, not its contents


[View source]
def fast_dirs? : Bool #

If true, directories depend on a list of files, not its contents


[View source]
def fast_mode=(fast_mode : Bool) #

If true, only compare file dates


[View source]
def fast_mode? : Bool #

If true, only compare file dates


[View source]
def get(key) #

[View source]
def inputs(targets : Array(String)) #

The set of all inputs for the given tasks


[View source]
def last_run : Hash(String, String) #

SHA1 of files from last run


[View source]
def last_run=(last_run : Hash(String, String)) #

SHA1 of files from last run


[View source]
def mark_stale_inputs #

Read state of last run, then scan inputs and compare


[View source]
def modified : Set(String) #

Registry of modified files, which will make tasks stale


[View source]
def modified=(modified : Set(String)) #

Registry of modified files, which will make tasks stale


[View source]
def next_run : Hash(String, String) #

SAH1 of input files as of ending this run


[View source]
def next_run=(next_run : Hash(String, String)) #

SAH1 of input files as of ending this run


[View source]
def progress_callback : Proc(String, Nil) #

If set, it's called after every task finishes


[View source]
def progress_callback=(progress_callback : Proc(String, Nil)) #

If set, it's called after every task finishes


[View source]
def run_tasks(run_all : Bool = false, dry_run : Bool = false, parallel : Bool = false, keep_going : Bool = false) #

Run all stale tasks in dependency order

If run_all is true, run non-stale tasks too If dry_run is true, only log what would be done, but don't do it If parallel is true, run tasks in parallel If keep_going is true, keep going even if a task fails


[View source]
def run_tasks(targets : Array(String), run_all : Bool = false, dry_run : Bool = false, parallel : Bool = false, keep_going : Bool = false) #

Run the tasks needed to create or update the requested targets

If run_all is true, run non-stale tasks too If dry_run is true, only log what would be done, but don't do it If parallel is true, run tasks in parallel If keep_going is true, keep going even if a task fails


[View source]
def save_run #

We ran all tasks, store the current state


[View source]
def scan_inputs #

Scan all inputs and return a hash with their sha1


[View source]
def set(key, value) #

[View source]
def sorted_task_graph #

[View source]
def tasks : Hash(String, Croupier::Task) #

Registry of all tasks


[View source]
def tasks=(tasks : Hash(String, Croupier::Task)) #

Registry of all tasks


[View source]
def this_run : Hash(String, String) #

SHA1 of files as of starting this run


[View source]
def this_run=(this_run : Hash(String, String)) #

SHA1 of files as of starting this run


[View source]
def use_persistent_store(path : String) #

Use a persistent k/v store in this path instead of the default memory store


[View source]
def watch(targets : Array(String) = [] of String) #

[View source]