Module B00.Exec
Build operation executors.
An executor is a parallel asynchronous work queue. It has no notion of synchronisation, any scheduled operation is randomly executed in parallel up to the executor's parallelizing limits.
Executors
type feedback=[|`Exec_submit of B0_std.Os.Cmd.pid option * Op.t]The type for executor feedbacks.
val pp_feedback : feedback B0_std.Fmt.tpp_feedbackformats executor feedback.
val create : ?clock:B0_std.Time.counter -> ?rand:Stdlib.Random.State.t -> ?tmp_dir:B0_std.Fpath.t -> ?feedback:(feedback -> unit) -> max_spawn:int -> unit -> tcreate ~clock ~rand ~tmp_dir ~notify_submit ~max_spawnwith:max_spawnthe maximal number of processes spawn simultaneously.feedbackcalled with each scheduled operation when it gets submitted for execution. Default is a nop.tmp_diris a directory for temporary files, it must exist; defaults toB0_std.Os.Dir.default_tmp().randrandom state used for internal queues; defaults toRandom.State.make_self_init.clock, the clock used to timestamp the operations; defaults toB0_std.Time.counter().
val schedule : t -> Op.t -> unitschedule e oschedulesofor execution ine. Just beforeois actually submitted for execution it is given to thenotify_submitcallback ofe(seecreate).
val collect : t -> block:bool -> Op.t optioncollect e ~blockremoves fromean operation that has completed (if any). Ifblockisfalseand no completed operation exists, the call returns immediately withNone. Ifblockistrueand at least one incomplete operation exists ine, the call blocks until an operation completes. Ifblockistrueand no operation exists ineNoneis returned.