The append-only event log — the durable source of truth for a session. One EDN form per line, so appending an event is O(1) and never rewrites the file, and the log stays scannable with ordinary line tools. Everything else in a run directory (session.edn, the table projections, usage, tree) is a projection of this stream, materialized at boundaries.
This namespace is deliberately tiny and dependency-free: it only knows how to
append an event value and read the stream back. What an event means lives in
event.clj (the pure reducer); how a session emits events lives in
artifacts.clj.
The append-only event log — the durable source of truth for a session. One EDN form per line, so appending an event is O(1) and never rewrites the file, and the log stays scannable with ordinary line tools. Everything else in a run directory (session.edn, the table projections, usage, tree) is a *projection* of this stream, materialized at boundaries. This namespace is deliberately tiny and dependency-free: it only knows how to append an event value and read the stream back. What an event *means* lives in `event.clj` (the pure reducer); how a session emits events lives in `artifacts.clj`.
(append! dir event)Append one event value as a single line. O(1), durable on return. Thread-safety
is the caller's responsibility — artifacts/emit! serializes appends per session.
Append one event value as a single line. O(1), durable on return. Thread-safety is the caller's responsibility — `artifacts/emit!` serializes appends per session.
(read-events dir)Read the full event stream back as a vector of values, in append order. Blank lines are skipped. A truncated final line (crash mid-append) is dropped rather than throwing — the recorded prefix is still authoritative.
Read the full event stream back as a vector of values, in append order. Blank lines are skipped. A truncated final line (crash mid-append) is dropped rather than throwing — the recorded prefix is still authoritative.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |