package tezt

  1. Overview
  2. Docs

Signature of schedulers to pass to run_with_scheduler.

type request =
  1. | Run_test of {
    1. test_title : string;
    }

Requests that schedulers can perform.

type response =
  1. | Test_result of test_result

Request results.

val run : on_worker_available:(unit -> (request * (response -> unit)) option) -> worker_count:int -> (unit -> unit) -> unit

Run a scheduler that manages several workers.

This starts worker_count workers. As soon as a worker is available, it calls on_worker_available. on_worker_available shall return None if there is nothing else to do, in which case the worker is killed, or Some (request, on_response), in which case the worker executes request. The result of this request, response, is then given to on_response.

The last argument is a continuation to call once there is nothing left to do.

val get_current_worker_id : unit -> int option

Get the current worker id.