class
Croupier::TaskManagerType
- Croupier::TaskManagerType
- Reference
- Object
Overview
TaskManager is a singleton that keeps track of all tasks
Defined in:
croupier.crInstance Method Summary
-
#_dependencies(outputs : Array(String))
Helper function for dependencies Uses memoization to avoid exponential blowup when many tasks share dependencies
-
#_run_tasks(task_names, run_all : Bool = false, dry_run : Bool = false, keep_going : Bool = false)
Internal helper to run tasks serially
-
#_run_tasks_parallel(task_names : Array(String) = [] of String, run_all : Bool = false, dry_run : Bool = false, keep_going : Bool = false)
Internal helper to run tasks concurrently
- #add_mutex(name : String)
- #all_inputs
-
#auto_mode=(auto_mode : Bool)
If true, it's running in auto mode
-
#auto_mode? : Bool
If true, it's running in auto mode
- #auto_run(targets : Array(String) = [] of String)
- #auto_stop
-
#before_run_hook : Proc(Set(String), Nil)
If set, it's called in auto mode after changes are detected but before tasks run Receives the list of changed files as an argument
-
#before_run_hook=(before_run_hook : Proc(Set(String), Nil))
If set, it's called in auto mode after changes are detected but before tasks run Receives the list of changed files as an argument
-
#check_dependencies
Check if all inputs are correct: They should all be either task outputs or existing files
-
#cleanup
Remove all tasks and everything else (good for tests)
-
#dependencies(outputs : Array(String))
Get a task list of what tasks need to be done to produce
outputsThe list is sorted so it can be executed in order -
#dependencies(output : String)
Get a task list of what tasks need to be done to produce
outputThe list is sorted so it can be executed in order Overloaded to accept a single string for convenience - #depends_on(input : String)
- #depends_on(inputs : Array(String))
-
#fast_dirs=(fast_dirs : Bool)
If true, directories depend on a list of files, not its contents
-
#fast_dirs? : Bool
If true, directories depend on a list of files, not its contents
-
#fast_mode=(fast_mode : Bool)
If true, only compare file dates
-
#fast_mode? : Bool
If true, only compare file dates
- #get(key)
-
#inputs(targets : Array(String))
The set of all inputs for the given tasks
-
#last_run : Hash(String, String)
SHA1 of files from last run
-
#last_run=(last_run : Hash(String, String))
SHA1 of files from last run
- #lock_mutex(name : String)
-
#mark_stale_inputs
Read state of last run, then scan inputs and compare
-
#modified : Set(String)
Registry of modified files, which will make tasks stale
-
#modified=(modified : Set(String))
Registry of modified files, which will make tasks stale
-
#mutexes : Hash(String, Mutex)
A hash of mutexes required by tasks
-
#mutexes=(mutexes : Hash(String, Mutex))
A hash of mutexes required by tasks
-
#next_run : Hash(String, String)
SAH1 of input files as of ending this run
-
#next_run=(next_run : Hash(String, String))
SAH1 of input files as of ending this run
-
#progress_callback : Proc(String, Nil)
If set, it's called after every task finishes
-
#progress_callback=(progress_callback : Proc(String, Nil))
If set, it's called after every task finishes
-
#propagate_staleness
Propagate staleness through the task graph in a single forward pass.
-
#run_tasks(run_all : Bool = false, dry_run : Bool = false, parallel : Bool = false, keep_going : Bool = false)
Run all stale tasks in dependency order
-
#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
-
#save_run
We ran all tasks, store the current state
-
#scan_inputs
Scan all inputs and return a hash with their sha1
- #set(key, value)
- #sorted_task_graph
-
#tasks : Hash(String, Croupier::Task)
Registry of all tasks
-
#tasks=(tasks : Hash(String, Croupier::Task))
Registry of all tasks
-
#this_run : Hash(String, String)
SHA1 of files as of starting this run
-
#this_run=(this_run : Hash(String, String))
SHA1 of files as of starting this run
- #unlock_mutex(name : String)
-
#use_persistent_store(path : String)
Use a persistent k/v store in this path instead of the default memory store
- #watch(targets : Array(String) = [] of String)
Instance Method Detail
Helper function for dependencies Uses memoization to avoid exponential blowup when many tasks share dependencies
Internal helper to run tasks serially
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.
If set, it's called in auto mode after changes are detected but before tasks run Receives the list of changed files as an argument
If set, it's called in auto mode after changes are detected but before tasks run Receives the list of changed files as an argument
Check if all inputs are correct: They should all be either task outputs or existing files
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
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
If set, it's called after every task finishes
Propagate staleness through the task graph in a single forward pass. This replaces the expensive recursive staleness checking with an O(V+E) algorithm that's critical for tasks with many inputs.
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
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
Use a persistent k/v store in this path instead of the default memory store