package current

  1. Overview
  2. Docs
type 'a t

An input that produces an 'a term.

type metadata

Information about a value of the input at some point.

val const : 'a -> 'a t

const x is an input that always evaluates to x and never needs to be updated.

val metadata : ?job_id:job_id -> ?changed:unit Lwt.t -> actions -> metadata

metadata actions is used to provide metadata about a value.

  • parameter job_id

    An ID that can be used to refer to this job later (to request a rebuild, etc).

  • parameter changed

    A Lwt promise that resolves when the input has changed (and so terms using it should be recalculated).

  • parameter actions

    Ways to interact with this input.

val of_fn : (Step.t -> 'a Current_term.Output.t * metadata) -> 'a t

of_fn f is an input that calls f config when it is evaluated. When f is called, the caller gets a ref-count on the watches and will call release exactly once when each watch is no longer needed.

Note: the engine calls f in an evaluation before calling release on the previous watches, so if the ref-count drops to zero then you can cancel the job.

OCaml

Innovation. Community. Security.