package picos

  1. Overview
  2. Docs
Pico scheduler framework

Install

Dune Dependency

Authors

Maintainers

Sources

picos-0.3.0.tbz
sha256=544804c0bde4b29764f82f04e7defed7c06bc43e5a6ce3f7fdc326cb54a7f066
sha512=4c93427e477fb52374a554a8b9c4c92836a9b5899161275d1473269ab526a1f59177209140631ed763a55be375855dea12f076e18bf4124522414986c0e257be

doc/picos.structured/Picos_structured/Control/index.html

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.