package miaou-core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-core.helpers/Miaou_helpers/Fiber_runtime/index.html
Module Miaou_helpers.Fiber_runtimeSource
Simple shared Eio runtime helpers.
The application must call init once from inside Eio_main.run to provide the standard environment and a long-lived switch.
Run f inside with_page_switch when a runtime is active; otherwise run f directly. Useful for drivers that may be constructed before the runtime is initialized but should still scope fibers when possible.
Run f inside a fresh page-scoped switch. All fibers spawned via spawn (or other helpers using require_current_switch) while f executes are attached to that switch and are cancelled when it closes. Nested calls replace the current page switch until they return.
Spawn a fiber on the current page switch if one is active, otherwise on the long-lived runtime switch.
Check if shutdown has been requested. Fibers should check this periodically.
Signal all fibers to stop. Call this before exiting the application.