Up

Module Time_source

Signature

include Time_source_intf.Time_source
module T1 : sig .. end
A time source has a phantom read-write parameter, where write gives permission to call advance and fire_past_alarms.
module Read_write : sig .. end
val sexp_of_t : t -> Sexplib.Sexp.t
include Core_kernel.Std.Invariant.S with type t := t
type t
val invariant : t Invariant_intf.inv
val read_only : [> ] T1.t -> t
val wall_clock : unit -> t

A time source with now t given by wall-clock time (i.e. Time_ns.now) and that is advanced automatically as time passes (specifically, at the start of each Async cycle).

val alarm_precision : [> ] T1.t -> Import.Time_ns.Span.t

Accessors.

val advance : [> ] T1.t -> to_:Import.Time_ns.t -> unit
val advance_by : [> ] T1.t -> Import.Time_ns.Span.t -> unit
val fire_past_alarms : [> ] T1.t -> unit
module Continue : sig .. end
val run_repeatedly : ?start:unit Time_source_intf.Deferred.t -> ?stop:unit Time_source_intf.Deferred.t -> ?continue_on_error:bool -> [> ] T1.t -> f:(unit -> unit Time_source_intf.Deferred.t) -> continue:Continue.t -> unit

The functions below here are the same as in clock_intf.ml, except they take an explicit t argument. See clock_intf.ml for documentation.

val run_at : [> ] T1.t -> Import.Time_ns.t -> ('a -> unit) -> 'a -> unit
val run_after : [> ] T1.t -> Import.Time_ns.Span.t -> ('a -> unit) -> 'a -> unit
val with_timeout : [> ] T1.t -> Import.Time_ns.Span.t -> 'a Time_source_intf.Deferred.t -> [
| `Timeout
| `Result of 'a
] Time_source_intf.Deferred.t
module Event : sig .. end
val at_varying_intervals : ?stop:unit Time_source_intf.Deferred.t -> [> ] T1.t -> (unit -> Import.Time_ns.Span.t) -> unit Async_stream.t
val every' : ?start:unit Time_source_intf.Deferred.t -> ?stop:unit Time_source_intf.Deferred.t -> ?continue_on_error:bool -> [> ] T1.t -> Import.Time_ns.Span.t -> (unit -> unit Time_source_intf.Deferred.t) -> unit
val every : ?start:unit Time_source_intf.Deferred.t -> ?stop:unit Time_source_intf.Deferred.t -> ?continue_on_error:bool -> [> ] T1.t -> Import.Time_ns.Span.t -> (unit -> unit) -> unit
val run_at_intervals' : ?start:Import.Time_ns.t -> ?stop:unit Time_source_intf.Deferred.t -> ?continue_on_error:bool -> [> ] T1.t -> Import.Time_ns.Span.t -> (unit -> unit Time_source_intf.Deferred.t) -> unit
val run_at_intervals : ?start:Import.Time_ns.t -> ?stop:unit Time_source_intf.Deferred.t -> ?continue_on_error:bool -> [> ] T1.t -> Import.Time_ns.Span.t -> (unit -> unit) -> unit