Liking cljdoc? Tell your friends :D

hyper.render.queue

Render queue — single coordination primitive for the per-tab renderer.

Replaces the previous atoms (pending-partials*, full-render-needed*, pending-scripts*) and Semaphore with a single LinkedBlockingQueue.

Writers (HTTP handler threads, reactive watch callbacks) enqueue typed events; the renderer fiber drains them in batches via drain!, which blocks until at least one event is available and then atomically drains all pending events into a categorized map.

This eliminates all shared mutable state between producer and consumer threads — the queue IS the coordination primitive.

Render queue — single coordination primitive for the per-tab renderer.

Replaces the previous atoms (pending-partials*, full-render-needed*,
pending-scripts*) and Semaphore with a single LinkedBlockingQueue.

Writers (HTTP handler threads, reactive watch callbacks) enqueue typed
events; the renderer fiber drains them in batches via `drain!`, which
blocks until at least one event is available and then atomically drains
all pending events into a categorized map.

This eliminates all shared mutable state between producer and consumer
threads — the queue IS the coordination primitive.
raw docstring

drain!clj

(drain! q)
(drain! q timeout-ms)

Block until at least one event is available, then drain all pending events.

Returns a categorized map: {:shutdown? boolean — true if a :shutdown event was present :full-render? boolean — true if any :full-render event was present :dirty-ids #{...} — set of component IDs needing partial render :scripts [...]} — vector of JS strings in FIFO order

When timeout-ms is given, blocks at most that long for the first event; if none arrives the result is flagged :idle? true (used to drive the heartbeat keepalive). The blocking single-arity never returns :idle?.

This is the only function that removes events from the queue. Designed for single-consumer use (the renderer fiber).

Block until at least one event is available, then drain all pending events.

Returns a categorized map:
  {:shutdown?    boolean   — true if a :shutdown event was present
   :full-render? boolean   — true if any :full-render event was present
   :dirty-ids   #{...}    — set of component IDs needing partial render
   :scripts     [...]}    — vector of JS strings in FIFO order

When `timeout-ms` is given, blocks at most that long for the first event;
if none arrives the result is flagged `:idle? true` (used to drive the
heartbeat keepalive).  The blocking single-arity never returns `:idle?`.

This is the only function that removes events from the queue.
Designed for single-consumer use (the renderer fiber).
sourceraw docstring

enqueue-full-render!clj

(enqueue-full-render! q)

Signal that a full page render is needed.

Signal that a full page render is needed.
sourceraw docstring

enqueue-partial!clj

(enqueue-partial! q component-id)

Signal that a reactive component needs re-rendering.

Signal that a reactive component needs re-rendering.
sourceraw docstring

enqueue-scripts!clj

(enqueue-scripts! q scripts)

Queue one or more scripts for SSE delivery to the client.

Queue one or more scripts for SSE delivery to the client.
sourceraw docstring

enqueue-shutdown!clj

(enqueue-shutdown! q)

Signal the renderer to shut down. Unblocks a pending drain! call.

Signal the renderer to shut down.  Unblocks a pending `drain!` call.
sourceraw docstring

make-queueclj

(make-queue)

Create a new render queue.

Create a new render queue.
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