X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fjobs.mli;fp=src%2Fjobs.mli;h=a5b79bb5b08eec399e65135229350e38acb5dd82;hb=614e2b7de8284ed70c004f5f2847d868c8e40e3b;hp=8aedbba9c6baef4346e3a91b0c1c1e3d8df977d9;hpb=bed4036653ce47a91b96dd0ead65341aa80d6b97;p=goals.git diff --git a/src/jobs.mli b/src/jobs.mli index 8aedbba..a5b79bb 100644 --- a/src/jobs.mli +++ b/src/jobs.mli @@ -21,14 +21,12 @@ type 'a next = Job of 'a * (unit -> unit) | Complete | Not_ready -type 'a retire = 'a -> unit +val run : (unit -> 'a next) -> ('a -> unit) -> ('a -> string) -> unit +(** [run next_job retire_job to_string] runs jobs in parallel. -type 'a to_string = 'a -> string - -val run : (unit -> 'a next) -> 'a retire -> 'a to_string -> unit -(** [run next_job retire_job] runs jobs in parallel. [next_job] - is called to pick the next available job. [retire_job] is - called when a job finishes successfully. + [next_job] is called to pick the next available job. + [retire_job] is called when a job finishes successfully. + [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).