package picos

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

Module Picos_structured.ControlSource

Basic control operations and exceptions for structured concurrency.

Sourceexception Terminate

An exception that is used to signal fibers, typically by canceling them, that they should terminate by letting the exception propagate. This does not, by itself, indicate an error.

Sourceexception Errors of Picos.Exn_bt.t list

An exception that can be used to collect exceptions, typically indicating errors, from multiple fibers.

Sourceval raise_if_canceled : unit -> unit

raise_if_canceled () checks whether the current fiber has been canceled and if so raises the exception that the fiber was canceled with.

Sourceval yield : unit -> unit

yield () asks the current fiber to be rescheduled.

Sourceval sleep : seconds:float -> unit

sleep ~seconds suspends the current fiber for specified number of seconds.

Sourceval protect : (unit -> 'a) -> 'a

protect thunk forbids cancelation for the duration of thunk ().

Sourceval block : unit -> 'a

block () suspends the current fiber until it is canceled at which point the cancelation exception will be raised.

⚠️ Beware that protect block never returns and you don't want that.

OCaml

Innovation. Community. Security.