package async
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=709041c755f4cd8740b7262e657f59c1066a8540b70c3b99368f369a1196a681
    
    
  doc/index.html
Async
The full API is browsable here.
Async is a library for asynchronous programming, i.e., programming where some part of the program must wait for things that happen at times determined by some external entity (like a human or another program). This includes pretty much any program that uses blocking calls (e.g., networking code, disk access), timeouts, or event loops (e.g., GUIs).
In a nutshell, the idea is to use non-preemptive user-level threads and first-class blocking operations with blocking expressed in the type system.
Read more in Chapter 18 of Real World OCaml.
Organization
Async comprises four packages, Async_command, Async_kernel, Async_rpc, and Async_unix.
- Async_kernelcontains Async's core data structures, like- Deferred.- Async_kernelis portable, and so can be used in JavaScript using- Async_js. In principle it could also be used on Windows, but no scheduler has been written for Async on Windows as of yet.
- Async_unixadds Unix dependencies for things like system calls and threads. Using these, it hooks the- Async_kernelscheduler up to either `epoll` or `select`, depending on availabilty, and manages a thread pool that blocking system calls run in.
- Async_commandextends- Core.Command's command-line handling
- Async_rpcadds RPC support.
You can most easily understand Async's API by reading the documentation of these individually.