package async_kernel
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=01ced973dbc70535f692f38bed524ae82dba17e26e58791b2fbf0d647b160d2e
doc/async_kernel/Async_kernel/Synchronous_time_source/Event/index.html
Module Synchronous_time_source.Event
Source
include Core.Invariant.S with type t := t
These are like the corresponding run_*
functions, except they return an event that one can later abort
.
val at_intervals :
?start:Core.Time_ns.t ->
[> Core.read ] T1.t ->
Core.Core_private.Time_ns_alternate_sexp.Span.t ->
callback ->
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.
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
.
If is_scheduled t
returns false, calling any of the below schedule_*
functions is guaranteed to not return an error.
schedule_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.t
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
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
scheduled_at
returns the time that the event is currently scheduled at