package async_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
include Core_kernel.Invariant.S with type t := t
val invariant : t -> unit
module Option : sig ... end

These are like the corresponding run_* functions, except they return an event that one can later abort.

module Abort_result : sig ... end
val abort : [> Core_kernel.read ] T1.t -> t -> Abort_result.t

abort t aborts the event t, if possible, and returns Ok if the event was aborted, or the reason it could not be aborted. abort returns Currently_happening iff it is called on an event while running that event's callback and the event is not scheduled at intervals.

val abort_exn : [> Core_kernel.read ] T1.t -> t -> unit
val abort_if_possible : [> Core_kernel.read ] T1.t -> t -> unit
val create : [> Core_kernel.read ] T1.t -> callback -> t

create timesource callback creates an event that is not scheduled in timesource's timing wheel but is available to be scheduled using schedule_at and schedule_after.

schedule_at timesource t time schedules t to fire at time. schedule_at returns Error if t is currently scheduled to run.

module Reschedule_result : sig ... end

reschedule_at timesource t time attempts to update t to next fire at time. This returns Ok for events that are unscheduled, or scheduled but not yet fired. If the event is in the process of firing or being aborted, reschedule_at does not succeed. For periodic events, reschedule updates the next time to fire, and leave the interval unchanged. Events rescheduled to a past time will fire at the next advance of timesource.

OCaml

Innovation. Community. Security.