- To submit a job to a group use [start group key f]. [group]
- is an existing group of jobs to which this is added. [key] is
- a key which ensures that two identical jobs cannot be running
- at the same time (across all groups). If two or more jobs
- with the same key are submitted then only one will run and
- the others will wait until the first finishes, and then another
- will be picked to run and so on. Jobs with different keys run
- freely in parallel, assuming there are enough threads available
- to run them.
+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.