package async_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Contains Async's core data structures, like Deferred, Ivar, and Clock.

Async_kernel is designed to depend only on Core_kernel (as opposed to Core), and so is more platform-independent.

module Async_kernel_config : sig ... end

Settings that globally affect the behavior of Async.

Deprecates functions that use wall-clock time, so that code must be explicit about what time source is used.

module Async_kernel_scheduler : sig ... end

Internal to Async -- see Async_unix.Scheduler for the public API.

module Bvar : sig ... end

A Bvar is a synchronization point that allows one to broadcast a value to clients waiting on the broadcast. With a Bvar, one can efficiently notify multiple clients of edge-triggered conditions, repeating as each edge trigger occurs.

module Clock_ns : sig ... end

Provides a Clock with Time_ns as the unit.

module Condition : sig ... end

Async's implementation of the standard notion of a "condition" variable.

module Deferred : sig ... end

A value that will become determined asynchronously.

module Execution_context : sig ... end

The context in which an Async job runs.

module Gc : sig ... end

Async's analog of Core_kernel.Gc.

module Invariant : sig ... end
module Ivar : sig ... end

A write-once cell that can be empty or full (i.e., hold a single value).

module Quickcheck : sig ... end
module Lazy_deferred : sig ... end

A delayed computation that can produce a deferred.

module Monad_sequence : sig ... end
module Monitor : sig ... end

The part of the Execution_context that determines what to do when there is an unhandled exception.

module Mvar : sig ... end

An Mvar is a mutable location that is either empty or contains a value. One can put or set the value, and wait on value_available for the location to be filled in either way.

module Pipe : sig ... end

A buffered FIFO communication channel.

module Priority : sig ... end

The priority of a job.

module Sequencer = Throttle.Sequencer
module Stream : sig ... end

An immutable sequence of values, with a possibly incomplete tail that may be extended asynchronously.

module Synchronous_time_source : sig ... end

A synchronous version of Async_kernel.Time_source. advance_by_alarms runs alarms immediately, rather than enqueueing Async jobs.

module Tail : sig ... end

A pointer to the end of an Async_stream that can be used to extend the stream.

module Throttle : sig ... end

A way to limit the number of concurrent computations.

module Time_source : sig ... end

Toplevel functions

The functions below are broadly useful when writing Async programs, and so are made available at the toplevel.

val after : Core_kernel.Core_kernel_private.Time_ns_alternate_sexp.Span.t -> unit Async_kernel__.Types.Deferred.t
val at : Core_kernel.Int63.t -> unit Async_kernel__.Types.Deferred.t
val catch : ((unit -> unit) -> exn Monitor.Deferred.t) Monitor.with_optional_monitor_name
val choice : 'a Deferred.t -> ('a -> 'b) -> 'b Deferred.Choice.t
val choose : 'a Deferred.Choice.t list -> 'a Deferred.t
val don't_wait_for : unit Deferred.t -> unit
val every : ?start:unit Async_kernel__.Types.Deferred.t -> ?stop:unit Async_kernel__.Types.Deferred.t -> ?continue_on_error:bool -> Core_kernel.Core_kernel_private.Time_ns_alternate_sexp.Span.t -> (unit -> unit) -> unit
val never : unit -> 'a Deferred.t
val schedule : ?monitor:Monitor.t -> ?priority:Priority.t -> (unit -> unit) -> unit
val schedule' : ?monitor:Monitor.t -> ?priority:Priority.t -> (unit -> 'a Async_kernel__.Types.Deferred.t) -> 'a Async_kernel__.Types.Deferred.t
val try_with : (?extract_exn:bool -> ?run:[ `Now | `Schedule ] -> ?rest:[ `Call of exn -> unit | `Log | `Raise ] -> (unit -> 'a Monitor.Deferred.t) -> ('a, exn) Core_kernel.Result.t Monitor.Deferred.t) Monitor.with_optional_monitor_name
val upon : 'a Deferred.t -> ('a -> unit) -> unit
val with_timeout : Core_kernel.Core_kernel_private.Time_ns_alternate_sexp.Span.t -> 'a Async_kernel__.Types.Deferred.t -> [ `Result of 'a | `Timeout ] Async_kernel__.Types.Deferred.t
val within : ?monitor:Monitor.t -> ?priority:Priority.t -> (unit -> unit) -> unit
val within' : ?monitor:Monitor.t -> ?priority:Priority.t -> (unit -> 'a Async_kernel__.Types.Deferred.t) -> 'a Async_kernel__.Types.Deferred.t

Infix operators and Let_syntax support

include Core_kernel.Monad.Infix with type 'a t := 'a Deferred.t
val (>>>) : 'a Async_kernel__.Types.Deferred.t -> ('a -> unit) -> unit

equivalent to Deferred.upon.

val (>>=?) : ('a, 'b) Deferred.Result.t -> ('a -> ('c, 'b) Deferred.Result.t) -> ('c, 'b) Deferred.Result.t

equivalent to Deferred.Result.bind.

val (>>|?) : ('a, 'b) Deferred.Result.t -> ('a -> 'c) -> ('c, 'b) Deferred.Result.t

equivalent to Deferred.Result.map.

include module type of struct include Deferred.Let_syntax end
val return : 'a -> 'a Deferred.t
val (>>=) : 'a Deferred.t -> ('a -> 'b Deferred.t) -> 'b Deferred.t
val (>>|) : 'a Deferred.t -> ('a -> 'b) -> 'b Deferred.t
module Let_syntax = Deferred.Let_syntax.Let_syntax
OCaml

Innovation. Community. Security.