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.
[ `Exec_submit of B0_std.Os.Cmd.pid option * B00.Op.t ]
The type for executor feedbacks.
val pp_feedback :
pp_feedback formats executor feedback.
The type for executors.
val create :
?feedback:(feedback -> unit) -> max_spawn:int -> unit -> t
create ~clock ~rand ~tmp_dir ~notify_submit ~max_spawn with:
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 to
randrandom state used for internal queues; defaults to
clock, the clock used to timestamp the operations; defaults to
val schedule :
t -> B00.Op.t -> unit
schedule e o schedules
o for execution in
e. Just before
o is actually submitted for execution it is given to the
notify_submit callback of
val collect :
t -> block:bool -> B00.Op.t option
collect e ~block removes from
e an operation that has
completed (if any). If
false and no completed
operation exists, the call returns immediately with
true and at least one incomplete operation exists
e, the call blocks until an operation completes. If
true and no operation exists in
None is returned.