Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Affect v0.0.0
Affect is a streamlined and natural concurrency model for OCaml.
It provides parallel asynchronous functions and first-class synchronous actions to orchestrate them. The resulting concurency model has structured cooperative concurrency, structured cancellation and structured effect handling.
Warning. These APIs are still subject to change in the future, especially the private ones. Feedback and suggestions are welcome on the project's issue tracker.
open Affect
let main () =
Fun.Async.main @@ fun () ->
let f0 = Fun.Async.call (fun () -> 1) in
let f1 = Fun.Async.call (fun () -> 2) in
print_int (Fun.Async.get f0 + Fun.Async.get f1);
0
let () = if !Sys.interactive then () else exit (main ())