package devkit

  1. Overview
  2. Docs
Development kit - general purpose library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.20261006.tar.gz
md5=a39dbbce04bd5562a9b4443daf39c582
sha512=b10104b61384b2151521b785e7f3c3250134c75eae09b42cad69bc4a22a9a5e429beb891ee87cedf376c23d9c40f09d3f71c3fd48aa35df490c0f69dc17f3242

doc/devkit.core/Devkit_core/Parallel/index.html

Module Devkit_core.ParallelSource

Parallel

Sourcetype revive_mode =
  1. | Never
    (*

    never revive worker

    *)
  2. | On_failure
    (*

    revive when worker exits with non-zero code

    *)
  3. | Always
    (*

    revive worker regardless of exit code

    *)
Sourceval invoke : ('a -> 'b) -> 'a -> unit -> 'b

Invoke function in a forked process and return result

Sourceval launch_forks : ('a -> unit) -> 'a list -> unit

Launch function for each element of the list in the forked process. Does not wait for children to finish - returns immediately.

Sourceval run_forks : ?wait_stop:int -> ?revive:revive_mode -> ?wait:int -> ?workers:int -> ('a -> unit) -> 'a list -> unit

Launch forks for each element of the list and wait for all workers to finish. Pass exit signals to the workers, see Forks.stop for the description of wait_stop parameter.

  • parameter revive

    to keep workers running (restarting with same param if exited) default: Never

Sourceval run_forks' : ('a -> unit) -> 'a list -> unit

Same as run_forks but do not fork for one worker

Sourceval run_workers : int -> ?wait_stop:int -> ('a -> unit) -> 'a list -> unit

Process list with specified number of workers. Pass exit signals to the workers, see Forks.stop for the description of wait_stop parameter.

Sourceval run_workers_enum : int -> ?wait_stop:int -> ('a -> 'b) -> ('b -> unit) -> 'a Enum.t -> unit

Process enum with specified number of workers, collect results via provided callback. Pass exit signals to the workers, see Forks.stop for the description of wait_stop parameter.

Sourcemodule type WorkerT = sig ... end
Sourcemodule type Workers = sig ... end
Sourcemodule Forks (T : WorkerT) : Workers with type task = T.task and type result = T.result

Forked workers

Sourcemodule Services : sig ... end