Module Async.Schedule

Scheduling parameters.

Priorities

Note. Priorities are currently ignored by Fun.Async.main.

type priority =
  1. | Low
    (*

    Background computation.

    *)
  2. | Normal
    (*

    Normal computation.

    *)
  3. | High
    (*

    Urgent or interactive computation.

    *)

The type for scheduling priority hints.

val pp_priority : Stdlib.Format.formatter -> priority -> unit

pp_priority formats priorities for inspection.

Scheduling parameters

type t

The type for function scheduling parameters.

val make : ?only_main:bool -> ?priority:priority -> unit -> t

make () are scheduling parameters with:

  • only_main if true the function is always only scheduled the main domain of the scheduler, i.e. the one which executes Affect.Fun.Async.main. Defaults to false.
  • priority is a scheduling priority hint. Defaults to the caller's priority.
val only_main : t -> bool

See make.

val priority : t -> priority option

See make. None means that the priority is inherited from the caller.

val default : t

default is make ().