L1 · the per-session live dispatch as a PURE MECHANISM — no store dependency
(09, GD8). store.memory implements the subscribe!/events-since/
notify-transient protocol methods by delegating here; the loop and api only
ever call the port methods. Delivery happens on a per-session daemon
dispatcher thread (lazily started on the first subscriber) so a slow or
throwing subscriber can neither stall nor corrupt a write. Durable events and
transient deltas share one ordered queue; on overflow transient deltas drop
first, a durable skip is a last resort, and either way one coalesced
:subscribe/gap is emitted so a subscriber recovers via events-since.
L1 · the per-session live dispatch as a PURE MECHANISM — no store dependency (09, GD8). `store.memory` implements the `subscribe!`/`events-since`/ `notify-transient` protocol methods by delegating here; the loop and api only ever call the port methods. Delivery happens on a per-session daemon dispatcher thread (lazily started on the first subscriber) so a slow or throwing subscriber can neither stall nor corrupt a write. Durable events and transient deltas share one ordered queue; on overflow transient deltas drop first, a durable skip is a last resort, and either way one coalesced `:subscribe/gap` is emitted so a subscriber recovers via `events-since`.
Bound to the session id while a callback runs on the dispatch thread. The store's append-event! and session's run-turn!/compact-session! check it and throw :subscribe/reentrant — a callback must not drive the session it observes.
Bound to the session id while a callback runs on the dispatch thread. The store's append-event! and session's run-turn!/compact-session! check it and throw :subscribe/reentrant — a callback must not drive the session it observes.
(make-dispatch sid {:keys [bound drop] :or {bound 1024 drop :drop-transient}})Create a per-session dispatch. The dispatcher thread is NOT started until the
first subscriber registers (most sessions never subscribe, so they pay for no
thread). opts: :bound (queue bound, default 1024), :drop (policy).
Create a per-session dispatch. The dispatcher thread is NOT started until the first subscriber registers (most sessions never subscribe, so they pay for no thread). `opts`: `:bound` (queue bound, default 1024), `:drop` (policy).
(notify-transient d item)Non-blocking enqueue of a TRANSIENT signal (no :event/id; droppable).
Non-blocking enqueue of a TRANSIENT signal (no :event/id; droppable).
(progress view)A ref-free live snapshot derived from a view value — no store dep, no payload hydration, safe to poll at high frequency.
A ref-free live snapshot derived from a view value — no store dep, no payload hydration, safe to poll at high frequency.
(schedule-notify d event)Non-blocking enqueue of a DURABLE event for off-lock delivery (called inside append-event!'s store lock; never blocks the writer).
Non-blocking enqueue of a DURABLE event for off-lock delivery (called inside append-event!'s store lock; never blocks the writer).
(stop-dispatch {:keys [alive lock]})Stop the dispatcher thread (idempotent). Daemon threads are JVM-exit-safe regardless; this avoids accumulating idle threads across many sessions.
Stop the dispatcher thread (idempotent). Daemon threads are JVM-exit-safe regardless; this avoids accumulating idle threads across many sessions.
(subscribe d callback)Register callback; start the dispatcher if needed. Returns an unsubscribe fn.
Register `callback`; start the dispatcher if needed. Returns an unsubscribe fn.
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 |