package current

  1. Overview
  2. Docs

Module Current.EngineSource

The main event loop.

Sourcetype t
Sourcetype results = {
  1. value : unit Current_term.Output.t;
  2. jobs : actions Job.Map.t;
    (*

    The jobs currently being used (whether running or finished).

    *)
}
Sourceval create : ?config:Config.t -> ?trace:(next:unit Lwt.t -> results -> unit Lwt.t) -> (unit -> unit term) -> t

create pipeline is a new engine running pipeline. The engine will evaluate t's pipeline immediately, and again whenever one of its inputs changes.

Sourceval update : unit -> unit

Primitives should call this after using Current_incr.change to run another step of the engine loop. This will (asynchronously) call Current_incr.propagate and perform any end-of-propagation activities.

Sourceval state : t -> results

The most recent results from evaluating the pipeline.

Sourceval thread : t -> 'a Lwt.t

thread t is the engine's thread. Use this to monitor the engine (in case it crashes).

Sourceval config : t -> Config.t
Sourceval pipeline : t -> unit term
Sourceval update_metrics : t -> unit

update_metrics t reports how many pipeline stages are in each state via Prometheus. Call this on each metrics collection if you have exactly one pipeline. The default web UI does this automatically.

Sourceval on_disable : (unit -> unit) -> unit

on_disable fn schedules fn () to be called after the next evaluation. You can increment a ref-count when calling this and then check it when the callback is called. If it is then zero, the operation is no longer required and you can e.g. cancel the job.

Sourcemodule Step : sig ... end
OCaml

Innovation. Community. Security.