package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
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

Sourcetype feedback = [
  1. | `Exec_start of B0_std.Os.Cmd.pid option * Op.t
]

The type for executor feedbacks. Indicates the given operation starts executig with, for spawn operations, their operating system process identifier.

Sourcetype t

The type for executors.

Sourceval 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 -> t

make ~clock ~rand ~tmp_dir ~feedback ~trash ~jobs with:

clock e is e's clock.

Sourceval tmp_dir : t -> B0_std.Fpath.t

tmp_dir e is e's temporary directory.

Sourceval trash : t -> Trash.t

trash e is e's trash.

Sourceval jobs : t -> int

jobs e is e's maximal number of simultaneous process spawns.

Scheduling and collecting operations

Sourceval schedule : t -> Op.t -> unit

schedule e o schedules o for execution in e. When o starts executing it is given to the feedback callback of e (see make).

Sourceval collect : t -> block:bool -> Op.t option

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.