package async_kernel
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=01ced973dbc70535f692f38bed524ae82dba17e26e58791b2fbf0d647b160d2e
    
    
  doc/async_kernel/Async_kernel/index.html
Module Async_kernelSource
Contains Async's core data structures, like Deferred, Ivar, and Clock.
Async_kernel is designed to depend only on Core and so is more platform-independent.
Deprecates functions that use wall-clock time, so that code must be explicit about what time source is used.
The Async scheduler is responsible for running Async jobs. It maintains the queue of jobs that need to run. A "cycle" consists of running some (possibly all) jobs in the queue, along with some other bookkeeping, like advancing Async's clock to the current time.
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.
Async's implementation of the standard notion of a "condition" variable.
The context in which an Async job runs.
A write-once cell that can be empty or full (i.e., hold a single value).
A delayed computation that can produce a deferred.
Monad_sequence.S is a generic interface specifying functions that deal with a container and a monad. It is specialized to the Deferred monad and used with various containers in modules Deferred.Array, Deferred.List, Deferred.Queue, and Deferred.Sequence. The Monad_sequence.how type specifies the parallelism of container iterators.
The part of the Execution_context that determines what to do when there is an unhandled exception.
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.
A job's priority determines when in an async cycle the job is run. A "cycle" runs a bounded number of Normal priority jobs followed by a bounded number of Low priority jobs. The bound is Async_kernel_config.max_num_jobs_per_priority_per_cycle.
An immutable sequence of values, with a possibly incomplete tail that may be extended asynchronously.
A synchronous version of Async_kernel.Time_source. advance_by_alarms runs alarms immediately, rather than enqueueing Async jobs.
A pointer to the end of an Async_stream that can be used to extend the stream.
An applicative type for concurrent computations with limited concurrency.
Toplevel functions
The functions below are broadly useful when writing Async programs, and so are made available at the toplevel.
val catch : 
  ?here:Core.Source_code_position.t ->
  ?info:Core.Info.t ->
  ?name:string ->
  (unit -> unit) ->
  exn Deferred.tval every : 
  ?start:unit Deferred.t ->
  ?stop:unit Deferred.t ->
  ?continue_on_error:bool ->
  Core.Core_private.Time_ns_alternate_sexp.Span.t ->
  (unit -> unit) ->
  unitval schedule' : 
  ?monitor:Monitor.t ->
  ?priority:Priority.t ->
  (unit -> 'a Deferred.t) ->
  'a Deferred.tval try_with : 
  ?here:Core.Source_code_position.t ->
  ?info:Core.Info.t ->
  ?name:string ->
  ?extract_exn:bool ->
  ?run:[ `Now | `Schedule ] ->
  ?rest:[ `Call of exn -> unit | `Log | `Raise ] ->
  (unit -> 'a Deferred.t) ->
  ('a, exn) Core.Result.t Deferred.tval with_timeout : 
  Core.Core_private.Time_ns_alternate_sexp.Span.t ->
  'a Deferred.t ->
  'a Clock_ns.Or_timeout.t Deferred.tval with_timeout_exn : 
  Core.Core_private.Time_ns_alternate_sexp.Span.t ->
  'a Deferred.t ->
  error:Core.Error.t ->
  'a Deferred.tval within' : 
  ?monitor:Monitor.t ->
  ?priority:Priority.t ->
  (unit -> 'a Deferred.t) ->
  'a Deferred.tInfix operators and Let_syntax support
include Core.Monad.Infix with type 'a t := 'a Deferred.t
equivalent to Deferred.upon.
val (>>=?) : 
  ('a, 'b) Deferred.Result.t ->
  ('a -> ('c, 'b) Deferred.Result.t) ->
  ('c, 'b) Deferred.Result.tequivalent to Deferred.Result.bind.
equivalent to Deferred.Result.map.
include module type of struct include Deferred.Let_syntax end
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.
t >>| f is t >>= (fun a -> return (f a)).