X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fjobs.mli;fp=src%2Fjobs.mli;h=9be4186cbcbf523a2cf601610540ffd4a893eb8f;hb=8a0ede3292b4968b1e3261ad97b96d5ea0ad16fd;hp=a5b79bb5b08eec399e65135229350e38acb5dd82;hpb=defebbd4c75d43ad2d171cccbcc7ed737ff8a035;p=goals.git diff --git a/src/jobs.mli b/src/jobs.mli index a5b79bb..9be4186 100644 --- a/src/jobs.mli +++ b/src/jobs.mli @@ -21,18 +21,22 @@ type 'a next = Job of 'a * (unit -> unit) | Complete | Not_ready -val run : (unit -> 'a next) -> ('a -> unit) -> ('a -> string) -> unit -(** [run next_job retire_job to_string] runs jobs in parallel. +val run : (unit -> 'a next) -> ('a -> unit) -> ('a -> unit) -> + ('a -> string) -> unit +(** [run next_job retire_job fail_job to_string] runs jobs in parallel. [next_job] is called to pick the next available job. [retire_job] is called when a job finishes successfully. + [fail_job] is called when a job fails (only in keep-going + -k mode). All jobs that depend on this one must be marked + failed by the caller. [to_string] is called if we need to print the job name. If [next_job] returns [Job f] then that function is started (usually in a thread if -j N > 1). If [next_job] returns [Complete] then [run] waits until - all parallel jobs are then returns. + all parallel jobs are finished then returns. If [next_job] returns [Not_ready] then [next_job] will be called again after a little while. @@ -40,4 +44,5 @@ val run : (unit -> 'a next) -> ('a -> unit) -> ('a -> string) -> unit If any job throws an exception then the exception will be reraised by [run], usually causing goals to exit with an error. The exception is delayed until all currently running jobs - finish, but no new jobs will be started during this time. *) + finish. In normal mode no new jobs will be started during + this time. In keep-going -k mode new jobs may be started. *)