package irmin
Tasks are used to keep track of the origin of reads and writes in the store. Every high-level operation is expected to have its own task which is passed to every low-level call.
Task
include Tc.S0
val compare : t Tc.compare
val to_json : t Tc.to_json
The REST inteface.
val of_json : t Tc.of_json
val size_of : t Tc.size_of
The serialization format.
val create : date:int64 -> owner:string -> ?uid:int64 -> string -> t
Create a new task.
val date : t -> int64
Get the task date.
The date provided by the user when calling the create function. Rounding Unix.gettimeofday ()
(when available) is a good value for such date. On more esoteric platforms, any monotonic counter is a fine value as well. On the Git backend, the date is translated into the commit Date field and is expected to be the number of POSIX seconds (thus not counting leap seconds) since the Epoch.
val owner : t -> string
Get the task owner.
The owner identifies the entity (human, unikernel, process, thread, etc) performing an operation. For the Git backend, this will be directly translated into the Author field.
val uid : t -> int64
Get the task unique identifier.
By default, it is freshly generated on each call to create. The identifier is useful for debugging purposes, for instance to relate debug lines to the tasks which cause them, and might appear in one line of the commit message for the Git backend.
val messages : t -> string list
val add : t -> string -> unit
Add a message to the task messages list. See messages for more details.
val empty : t
The empty task.
Task creators
type 'a f = 'a -> t
The type for user-defined task creators.
val none : unit f
The empty task creator.