package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.memo/B0_zero/Exec/index.html
Module B0_zero.ExecSource
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
The type for executor feedbacks. Indicates the given operation starts executig with, for spawn operations, their operating system process identifier.
The type for executors.
val make :
?clock:B0_std.Os.Mtime.counter ->
?rand:Random.State.t ->
?tmp_dir:B0_std.Fpath.t ->
?feedback:(feedback -> unit) ->
trash:Trash.t ->
jobs:int ->
unit ->
tmake ~clock ~rand ~tmp_dir ~feedback ~trash ~jobs with:
clock, the clock used to timestamp build operations; defaults toB0_std.Os.Mtime.counter().randrandom state used for internal queues; defaults toRandom.State.make_self_init.tmp_diris a directory for temporary files, it must exist; defaults toB0_std.Os.Dir.default_tmp().feedbacka function called with each scheduled operation when it starts executing. Default is a nop.trash, the trash used to executeB0_zero.Op.Deletebuild operations.jobsthe maximal number of processes spawn simultaneously.
clock e is e's clock.
tmp_dir e is e's temporary directory.
Scheduling and collecting operations
schedule e o schedules o for execution in e. When o starts executing it is given to the feedback callback of e (see make).
collect e ~block removes from e an operation that has completed (if any). If block is false and no completed operation exists, the call returns immediately with None. If block is true and at least one incomplete operation exists in e, the call blocks until an operation completes. If block is true and no operation exists in e None is returned.