Module Async_unix__.Import

include Async_kernel

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 = Async_kernel.Async_kernel_config
module Async_kernel_persistent_connection = Async_kernel__.Persistent_connection
module Async_kernel_require_explicit_time_source = Async_kernel__.Require_explicit_time_source
module Async_kernel_scheduler = Async_kernel__.Scheduler
module Bvar = Async_kernel.Bvar
module Clock_ns = Async_kernel.Clock_ns
module Deferred = Async_kernel.Deferred
module Eager_deferred = Async_kernel.Eager_deferred
module Execution_context = Async_kernel.Execution_context
module Ivar = Async_kernel.Ivar
module Lazy_deferred = Async_kernel.Lazy_deferred
module Limiter = Limiter_in_this_directory
module Monad_sequence = Async_kernel.Monad_sequence
module Monitor = Async_kernel.Monitor
module Mvar = Async_kernel.Mvar
module Pipe = Async_kernel.Pipe
module Priority = Async_kernel.Priority
module Sequencer = Throttle.Sequencer
module Synchronous_time_source = Async_kernel.Synchronous_time_source
module Tail = Async_kernel.Tail
module Throttle = Async_kernel.Throttle
module Time_source = Async_kernel.Time_source
module Use_eager_deferred = Async_kernel.Use_eager_deferred

Intended usage is to open Use_eager_deferred to shadow operations from the non-eager world and rebind them to their eager counterparts.

Toplevel functions

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

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__.Clock_intf.Deferred.t ‑> ?⁠stop:unit Async_kernel__.Clock_intf.Deferred.t ‑> ?⁠continue_on_error:bool ‑> Async_kernel__.Import.Time_ns.Span.t ‑> (unit ‑> unit) ‑> unit
val never : unit ‑> 'a Deferred.t
val schedule : ((unit ‑> unit) ‑> unit) Async_kernel__.Scheduler.with_options
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 within : ((unit ‑> unit) ‑> unit) Async_kernel__.Scheduler.with_options

Infix operators and Let_syntax support

include Core_kernel.Monad.Infix with type t := a Deferred.t
type 'a t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

t >>= f returns a computation that sequences the computations represented by two monad elements. The resulting computation first does t to yield a value v, and then runs the computation returned by f v.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

t >>| f is t >>= (fun a -> return (f a)).

val (>>>) : 'a Async_kernel__Deferred.t ‑> ('a ‑> unit) ‑> unit

equivalent to Deferred.upon.

val (>>=?) : ('a'bDeferred.Result.t ‑> ('a ‑> ('c'bDeferred.Result.t) ‑> ('c'bDeferred.Result.t

equivalent to Deferred.Result.bind.

val (>>|?) : ('a'bDeferred.Result.t ‑> ('a ‑> 'c) ‑> ('c'bDeferred.Result.t

equivalent to Deferred.Result.map.

include Deferred.Let_syntax

These are convenient to have in scope when programming with a monad:

val return : 'a ‑> 'a Deferred.t
include Base__.Monad_intf.Infix with type t := a Deferred.t
type 'a t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

t >>= f returns a computation that sequences the computations represented by two monad elements. The resulting computation first does t to yield a value v, and then runs the computation returned by f v.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

t >>| f is t >>= (fun a -> return (f a)).

module Let_syntax = Deferred.Let_syntax.Let_syntax
module Epoll_max_ready_events = Async_unix__.Config.Epoll_max_ready_events
module Max_inter_cycle_timeout = Async_unix__.Config.Max_inter_cycle_timeout
module Max_num_open_file_descrs = Async_unix__.Config.Max_num_open_file_descrs
module Max_num_threads = Async_unix__.Config.Max_num_threads
module Min_inter_cycle_timeout = Async_unix__.Config.Min_inter_cycle_timeout
module Debug = Async_kernel_private.Debug
module Job = Async_kernel_private.Job
module Kernel_scheduler = Async_kernel_scheduler
module File_descr = Core.Unix.File_descr
val print_s : Core.Sexp.t ‑> Base.unit
include Core.Int.Replace_polymorphic_compare
include Base.Comparisons.Infix
type t
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val (=) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
val (<>) : t ‑> t ‑> bool
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int

compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.

val min : t ‑> t ‑> t
val max : t ‑> t ‑> t