package lsp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

Pool is used to submit asynchronous tasks without waiting for their completion.

val create : unit -> t

Create a new pool.

val running : t -> bool t

running pool returns whether it's possible to submit tasks to pool

val task : t -> f:(unit -> unit t) -> unit t

task pool ~f submit f to be done in pool. Errors raised pool will not be raised in the current fiber, but inside the Pool.run fiber.

If running pool returns false, this function will raise a Code_error.

val stop : t -> unit t

stop pool stops the pool from receiving new tasks. After this function is called, task pool ~f will fail to submit new tasks.

Note that stopping the pool does not prevent already queued tasks from running.

val run : t -> unit t

run pool Runs all tasks submitted to pool in parallel. Errors raised by such tasks must be caught here.