package datakit-ci

  1. Overview
  2. Docs

Monitored Pool of Workers

type t

The type for pools of workers.

val create : string -> int -> t

create s n create a new pool with n workers.

val use : t -> ?log:Live_log.t -> ?label:string -> job_id -> (unit -> 'a Lwt.t) -> 'a Lwt.t

use t job fn evaluates fn () with one pool resource held. job (and label) will be displayed as the reason why the resource is in use. If log is provided then a message will be logged if we have to wait, and if the log is cancellable then the user will be able to cancel the operation.