package async_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val sexp_of_t : t -> Sexplib0.Sexp.t
include Core.Invariant.S with type t := t
val invariant : t Base__Invariant_intf.inv
module Option : sig ... end
val at : [> Core.read ] T1.t -> Core.Time_ns.t -> callback -> t

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.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.

val abort_exn : [> Core.read ] T1.t -> t -> unit
val abort_if_possible : [> Core.read ] T1.t -> t -> unit
val create : [> Core.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.

val is_scheduled : t -> bool

If is_scheduled t returns false, calling any of the below schedule_* functions is guaranteed to not return an error.

val schedule_at : [> Core.read ] T1.t -> t -> Core.Time_ns.t -> unit Core.Or_error.t

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

val schedule_at_intervals : [> Core.read ] T1.t -> t -> Core.Core_private.Time_ns_alternate_sexp.Span.t -> unit Core.Or_error.t
val schedule_at_intervals' : [> Core.read ] T1.t -> t -> Core.Core_private.Time_ns_alternate_sexp.Span.t -> starting_at:Core.Time_ns.t -> unit Core.Or_error.t
val reschedule_at : [> Core.read ] T1.t -> t -> Core.Time_ns.t -> unit

reschedule_at timesource t time updates t to next fire at time.

For periodic events, reschedule updates the next time to fire, and leaves the interval unchanged. Events rescheduled to a past time will fire at the next advance of timesource.

val reschedule_after : [> Core.read ] T1.t -> t -> Core.Core_private.Time_ns_alternate_sexp.Span.t -> unit
val scheduled_at : t -> Core.Time_ns.t

scheduled_at returns the time that the event is currently scheduled at

OCaml

Innovation. Community. Security.