package async_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val events : Async_kernel__.Types.Scheduler.t -> Async_kernel__Types.Job_or_event.t Core_kernel.Timing_wheel_ns.t
val set_execution_context : Async_kernel__.Types.Scheduler.t -> Async_kernel__Types.Execution_context.t -> unit
module Synchronous_time_source : sig ... end
val debug : bool
module Ivar : sig ... end
module Bvar : sig ... end
module Very_low_priority_worker : sig ... end
type t = {
  1. mutable check_access : (unit -> unit) option;
  2. mutable job_pool : (Execution_context.t, Obj.t -> unit, Obj.t) Core_kernel.Pool.Slots.t3 Core_kernel.Pool.t;
  3. normal_priority_jobs : Async_kernel__.Types.Job_queue.t;
  4. low_priority_jobs : Async_kernel__.Types.Job_queue.t;
  5. very_low_priority_workers : Very_low_priority_worker.t Core_kernel.Deque.t;
  6. mutable main_execution_context : Execution_context.t;
  7. mutable current_execution_context : Execution_context.t;
  8. mutable uncaught_exn : (Core_kernel.Exn.t * Core_kernel.Sexp.t) option;
  9. mutable cycle_count : int;
  10. mutable cycle_start : Core_kernel.Int63.t;
  11. mutable run_every_cycle_start : (unit -> unit) list;
  12. mutable last_cycle_time : Core_kernel.Core_kernel_private.Time_ns_alternate_sexp.Span.t;
  13. mutable last_cycle_num_jobs : int;
  14. mutable time_source : Core_kernel.read_write Synchronous_time_source.T1.t;
  15. external_jobs : Async_kernel__.Types.External_job.t Core_kernel.Thread_safe_queue.t;
  16. mutable thread_safe_external_job_hook : unit -> unit;
  17. mutable job_queued_hook : (Priority.t -> unit) option;
  18. mutable event_added_hook : (Core_kernel.Int63.t -> unit) option;
  19. mutable yield : (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque;
  20. mutable yield_until_no_jobs_remain : (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque;
  21. mutable check_invariants : bool;
  22. mutable max_num_jobs_per_priority_per_cycle : (int, Async_kernel__.Config.Max_num_jobs_per_priority_per_cycle.witness) Core_kernel.Validated.t;
  23. mutable record_backtraces : bool;
  24. mutable on_start_of_cycle : unit -> unit;
  25. mutable on_end_of_cycle : unit -> unit;
}
val on_end_of_cycle : t -> unit -> unit
val set_on_end_of_cycle : t -> (unit -> unit) -> unit
val on_start_of_cycle : t -> unit -> unit
val set_on_start_of_cycle : t -> (unit -> unit) -> unit
val record_backtraces : t -> bool
val set_record_backtraces : t -> bool -> unit
val max_num_jobs_per_priority_per_cycle : t -> (int, Async_kernel__.Config.Max_num_jobs_per_priority_per_cycle.witness) Core_kernel.Validated.t
val set_max_num_jobs_per_priority_per_cycle : t -> (int, Async_kernel__.Config.Max_num_jobs_per_priority_per_cycle.witness) Core_kernel.Validated.t -> unit
val check_invariants : t -> bool
val set_check_invariants : t -> bool -> unit
val yield_until_no_jobs_remain : t -> (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque
val set_yield_until_no_jobs_remain : t -> (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque -> unit
val yield : t -> (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque
val set_yield : t -> (unit, Core_kernel.read_write) Async_kernel__.Types.Bvar.t Core_kernel.sexp_opaque -> unit
val event_added_hook : t -> (Core_kernel.Int63.t -> unit) option
val set_event_added_hook : t -> (Core_kernel.Int63.t -> unit) option -> unit
val job_queued_hook : t -> (Priority.t -> unit) option
val set_job_queued_hook : t -> (Priority.t -> unit) option -> unit
val thread_safe_external_job_hook : t -> unit -> unit
val set_thread_safe_external_job_hook : t -> (unit -> unit) -> unit
val external_jobs : t -> Async_kernel__.Types.External_job.t Core_kernel.Thread_safe_queue.t
val set_time_source : t -> Core_kernel.read_write Synchronous_time_source.T1.t -> unit
val last_cycle_num_jobs : t -> int
val set_last_cycle_num_jobs : t -> int -> unit
val run_every_cycle_start : t -> (unit -> unit) list
val set_run_every_cycle_start : t -> (unit -> unit) list -> unit
val cycle_start : t -> Core_kernel.Int63.t
val set_cycle_start : t -> Core_kernel.Int63.t -> unit
val cycle_count : t -> int
val set_cycle_count : t -> int -> unit
val set_uncaught_exn : t -> (Core_kernel.Exn.t * Core_kernel.Sexp.t) option -> unit
val set_current_execution_context : t -> Execution_context.t -> unit
val main_execution_context : t -> Execution_context.t
val set_main_execution_context : t -> Execution_context.t -> unit
val very_low_priority_workers : t -> Very_low_priority_worker.t Core_kernel.Deque.t
val low_priority_jobs : t -> Async_kernel__.Types.Job_queue.t
val normal_priority_jobs : t -> Async_kernel__.Types.Job_queue.t
val job_pool : t -> (Execution_context.t, Obj.t -> unit, Obj.t) Core_kernel.Pool.Slots.t3 Core_kernel.Pool.t
val set_job_pool : t -> (Execution_context.t, Obj.t -> unit, Obj.t) Core_kernel.Pool.Slots.t3 Core_kernel.Pool.t -> unit
module Fields : sig ... end
val sexp_of_t : t -> Sexplib.Sexp.t
val uncaught_exn_unwrapped : t -> (Core_kernel.Exn.t * Core_kernel.Sexp.t) option
val uncaught_exn : t -> Core_kernel.Error.t option
val num_pending_jobs : t -> int
val num_jobs_run : t -> int
val invariant : t -> unit
val free_job : t -> (Execution_context.t, Obj.t -> unit, Obj.t) Core_kernel.Pool.Slots.t3 Core_kernel.Pool.Pointer.t -> Base.Unit.t
val enqueue : t -> Execution_context.t -> ('a -> unit) -> 'a -> unit
val enqueue_job : t -> (Execution_context.t * (Obj.t -> unit) * Obj.t, [ `S0 of Execution_context.t | `S1 of Obj.t -> unit | `S2 of Obj.t ]) Core_kernel.Pool.Slots.t Core_kernel.Pool.Pointer.t -> free_job:bool -> Base.Unit.t
val handle_fired : 'a Synchronous_time_source.T1.t -> Async_kernel__.Types.Job_or_event.t -> Base.Unit.t
val create : unit -> t
val is_dead : t -> bool
val set_check_access : t -> (unit -> unit) option -> unit
val t_ref : t Core_kernel.ref
val check_access : t -> unit
val t : unit -> t
val current_execution_context : t -> Execution_context.t
val with_execution_context : t -> Async_kernel__Types.Execution_context.t -> f:(unit -> 'a) -> 'a
val create_job : t -> Execution_context.t -> ('a -> unit) -> 'a -> (Execution_context.t, Obj.t -> unit, Obj.t) Core_kernel.Pool.Slots.t3 Core_kernel.Pool.Pointer.t
val got_uncaught_exn : t -> Core_kernel.Exn.t -> Core_kernel.Sexp.t -> unit
val start_cycle : t -> max_num_jobs_per_priority: (int, Async_kernel__.Config.Max_num_jobs_per_priority_per_cycle.witness) Core_kernel.Validated.t -> unit

start_cycle t ~max_num_jobs_per_priority enables subsequent calls of run_jobs to run up to max_num_jobs_per_priority jobs of each priority level.

val run_jobs : t -> (unit, exn * Core_kernel.Backtrace.t) Core_kernel._result

run_jobs t removes jobs from t one at a time and runs them, stopping as soon as an unhandled exception is raised, or when no more jobs can be run at any priority, as per ~max_num_jobs_per_priority.

val stabilize : t -> (unit, exn) Core_kernel._result
val create_time_source : ?timing_wheel_config:Core_kernel.Timing_wheel_ns.Config.t -> now:Core_kernel.Timing_wheel_ns.Time.t -> unit -> 'a Synchronous_time_source.T1.t
val wall_clock : unit -> Synchronous_time_source.t
OCaml

Innovation. Community. Security.