package miaou-core

  1. Overview
  2. Docs
Miaou core/widgets (no drivers, no SDL)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
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.

Sourceval init : env:Eio_unix.Stdenv.base -> sw:Eio.Switch.t -> unit
Sourceval env_opt : unit -> Eio_unix.Stdenv.base option
Sourceval switch_opt : unit -> Eio.Switch.t option
Sourceval page_switch_opt : unit -> Eio.Switch.t option
Sourceval require_runtime : unit -> Eio_unix.Stdenv.base * Eio.Switch.t
Sourceval require_env_and_switch : unit -> Eio_unix.Stdenv.base * Eio.Switch.t
Sourceval require_current_switch : unit -> Eio.Switch.t
Sourceval with_page_scope : (unit -> 'a) -> 'a

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.

Sourceval with_page_switch : (Eio_unix.Stdenv.base -> Eio.Switch.t -> 'a) -> 'a

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.

Sourceval with_env : (Eio_unix.Stdenv.base -> 'a) -> 'a
Sourceval spawn : (Eio_unix.Stdenv.base -> unit) -> unit

Spawn a fiber on the current page switch if one is active, otherwise on the long-lived runtime switch.

Sourceval sleep : float -> unit
Sourceval is_shutdown : unit -> bool

Check if shutdown has been requested. Fibers should check this periodically.

Sourceval shutdown : unit -> unit

Signal all fibers to stop. Call this before exiting the application.