package picos
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=343a8b4759239ca0c107145b8e2cc94c14625fecc0b0887d3c40a9ab7537b8da
sha512=db22b0a5b3adc603c0e815c9011c779f892b9ace76be018b2198d3e24a7d96727c999701025fe5a5fd07d0b452cb7286fc50c939aba0e4dce809941e9ebc12a6
doc/picos.structured/Picos_structured/Run/index.html
Module Picos_structured.Run
Source
Operations for running fibers in specific patterns.
all actions
starts the actions as separate fibers and waits until they all complete or one of them raises an unhandled exception other than Terminate
, which is not counted as an error, after which the remaining fibers will be canceled.
⚠️ It is not guaranteed that any of the actions in the list are called. In particular, after any action raises an unhandled exception or after the main fiber is canceled, the actions that have not yet started may be skipped entirely.
all
is roughly equivalent to
let all actions =
Bundle.join_after @@ fun bundle ->
List.iter (Bundle.fork bundle) actions
but treats the list of actions as a single computation.
any actions
starts the actions as separate fibers and waits until one of them completes or raises an unhandled exception other than Terminate
, which is not counted as an error, after which the rest of the started fibers will be canceled.
⚠️ It is not guaranteed that any of the actions in the list are called. In particular, after the first action returns successfully or after any action raises an unhandled exception or after the main fiber is canceled, the actions that have not yet started may be skipped entirely.
any
is roughly equivalent to
let any actions =
Bundle.join_after @@ fun bundle ->
try
actions
|> List.iter @@ fun action ->
Bundle.fork bundle @@ fun () ->
action ();
Bundle.terminate bundle
with Control.Terminate -> ()
but treats the list of actions as a single computation.