package async_kernel
Module Synchronous_time_source.Event
val sexp_of_t : t -> Sexplib0.Sexp.tinclude Core.Invariant.S with type t := t
val invariant : t Base__.Invariant_intf.invmodule Option : sig ... endval at : [> Core.read ] T1.t -> Core.Time_ns.t -> callback -> tThese are like the corresponding run_* functions, except they return an event that one can later abort.
val after :
[> Core.read ] T1.t ->
Core.Core_private.Time_ns_alternate_sexp.Span.t ->
callback ->
tval at_intervals :
[> Core.read ] T1.t ->
Core.Core_private.Time_ns_alternate_sexp.Span.t ->
callback ->
tmodule Abort_result : sig ... endval abort : [> Core.read ] T1.t -> t -> Abort_result.tabort 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.
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 schedule_at :
[> Core.read ] T1.t ->
t ->
Core.Time_ns.t ->
unit Core.Or_error.tschedule_at timesource t time schedules t to fire at time. schedule_at returns Error if t is currently scheduled to run.
val schedule_after :
[> Core.read ] T1.t ->
t ->
Core.Core_private.Time_ns_alternate_sexp.Span.t ->
unit Core.Or_error.tval schedule_at_intervals :
[> Core.read ] T1.t ->
t ->
Core.Core_private.Time_ns_alternate_sexp.Span.t ->
unit Core.Or_error.tval reschedule_at : [> Core.read ] T1.t -> t -> Core.Time_ns.t -> unitreschedule_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 ->
unitval scheduled_at : t -> Core.Time_ns.tscheduled_at returns the time that the event is currently scheduled at