Liking cljdoc? Tell your friends :D

vaelii.koinii.types

Koinii's two protocols, as a held namespace: the development browser's reloader never re-evaluates it (docs/web.md, Hot reload), because a re-evaluated defprotocol defines a new interface and a running channel's medium and cursor store would stop answering it. It requires no vaelii namespace. The records that implement them are defined with their methods inline: the media in vaelii.koinii.channel, the cursor store in vaelii.koinii.catchup.

Koinii's two protocols, as a held namespace: the development browser's reloader never
re-evaluates it (docs/web.md, *Hot reload*), because a re-evaluated `defprotocol` defines
a new interface and a running channel's medium and cursor store would stop answering it.
It requires no vaelii namespace.  The records that implement them are defined with their
methods inline: the media in `vaelii.koinii.channel`, the cursor store in
`vaelii.koinii.catchup`.
raw docstring

CursorStorecljprotocol

Where an agent keeps 'the last feed position I processed' — {:token :cursor} — so a restart RESUMES the stream rather than re-reading everything. Deliberately CLIENT-SIDE (D7): a cursor in a KB context would be self-describing but would write to the shared truth on every poll, turning a read loop into a write loop through the single writer. A deployment backs this with a file, the agent's own store, or a row — anything durable and local; the atom store below is the in-memory default.

Where an agent keeps 'the last feed position I processed' — `{:token :cursor}` — so a
restart RESUMES the stream rather than re-reading everything.  Deliberately CLIENT-SIDE
(D7): a cursor in a KB context would be self-describing but would write to the shared
truth on every poll, turning a read loop into a write loop through the single writer.  A
deployment backs this with a file, the agent's own store, or a row — anything durable and
local; the atom store below is the in-memory default.

read-positionclj

(read-position store)

The stored {:token :cursor}, or nil if none.

The stored `{:token :cursor}`, or nil if none.

write-position!clj

(write-position! store position)

Persist {:token :cursor}; returns it.

Persist `{:token :cursor}`; returns it.
sourceraw docstring

Mediumcljprotocol

The transport a channel runs over — a daemon connection (wire, cross-process) or an in-process KB (local, single-process). Everything above this protocol is written once and runs over either; the two implementations differ only where the engine does — in how a subscription is delivered.

The transport a channel runs over — a daemon connection (`wire`, cross-process) or an
in-process KB (`local`, single-process).  Everything above this protocol is written
once and runs over either; the two implementations differ only where the engine does —
in how a subscription is delivered.

-subscribeclj

(-subscribe medium goal context callback opts)

Register callback for events matching goal in context (nil goal = every change). Returns {:token … :stop (fn []) …}. Where the two media genuinely diverge — a wire poll loop off the agent's thread, vs an in-process listener.

Register `callback` for events matching `goal` in `context` (nil `goal` = every
change).  Returns `{:token … :stop (fn []) …}`.  Where the two media genuinely
diverge — a wire poll loop off the agent's thread, vs an in-process listener.

-sentexclj

(-sentex medium handle)

The stored sentex handle names, as a map (:sentence …).

The stored sentex `handle` names, as a map (`:sentence` …).

-assertclj

(-assert medium sentence context opts)

Assert sentence in context with opts (carrying :creator), returning the handle. The daemon stamps :creator from the opts — the cooperative identity annotation crossing the wire (identity), since *creator* is a var in the daemon's process, not the client's.

Assert `sentence` in `context` with `opts` (carrying `:creator`), returning the
handle.  The daemon stamps `:creator` from the opts — the cooperative identity
annotation crossing the wire (`identity`), since `*creator*` is a var in the daemon's
process, not the client's.

-feed-pollclj

(-feed-poll medium token cursor opts)

Read a raw subscription forward — {:events :cursor :lagged}. :lagged non-zero is the whole point of catch-up: the cursor fell off the ring. Local THROWS, as above.

Read a raw subscription forward — `{:events :cursor :lagged}`.  `:lagged` non-zero is
the whole point of catch-up: the cursor fell off the ring.  Local THROWS, as above.

-matchingclj

(-matching medium sentence context)

The believed sentexes matching sentence in context (a ?ctx matches anywhere).

The believed sentexes matching `sentence` in `context` (a `?ctx` matches anywhere).

-check-editclj

(-check-edit medium batch)

check-edit over an {:add […] :remove […]} batch — the dry run, storing nothing. A vector of problems, empty when admissible.

`check-edit` over an `{:add […] :remove […]}` batch — the dry run, storing nothing.
A vector of problems, empty when admissible.

-editclj

(-edit medium batch)

Apply an {:add […] :remove […]} batch in one settle.

Apply an `{:add […] :remove […]}` batch in one settle.

-feed-openclj

(-feed-open medium goal context)

Open a raw change-feed subscription with a cursor — {:token :cursor :max-events}. The wire feed's cursor primitive that catch-up (catchup) resumes from; -subscribe wraps it for the happy path, this exposes it for the durable-cursor / lag case. A local (in-process) medium THROWS: core/watch is callback-based with no ring or cursor, so there is nothing to fall off and nothing to resume.

Open a raw change-feed subscription with a cursor — `{:token :cursor :max-events}`.
The wire feed's cursor primitive that catch-up (`catchup`) resumes from; `-subscribe`
wraps it for the happy path, this exposes it for the durable-cursor / lag case.  A
local (in-process) medium THROWS: `core/watch` is callback-based with no ring or
cursor, so there is nothing to fall off and nothing to resume.

-queryclj

(-query medium goal context)

Solutions for goal in context as binding maps — the ANCESTOR-SET-AWARE read (walks the genlCx ancestor set, unlike -matching, so a channel read sees its agents' own-context sentexes). The snapshot half of catch-up (catchup) reads through this.

Solutions for `goal` in `context` as binding maps — the ANCESTOR-SET-AWARE read (walks the
genlCx ancestor set, unlike `-matching`, so a channel read sees its agents' own-context
sentexes).  The snapshot half of catch-up (`catchup`) reads through this.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close