The datastar-cl Reference Manual
1 Systems
1.1 datastar-cl
1.2 datastar-cl/hunchentoot
1.3 datastar-cl/core
1.4 datastar-cl/clack
2 Files
2.1 Lisp
2.1.1 datastar-cl/datastar-cl.asd
2.1.2 datastar-cl/hunchentoot/hunchentoot.lisp
2.1.3 datastar-cl/core/package.lisp
2.1.4 datastar-cl/core/conditions.lisp
2.1.5 datastar-cl/core/config.lisp
2.1.6 datastar-cl/core/compression.lisp
2.1.7 datastar-cl/core/signals.lisp
2.1.8 datastar-cl/core/datastar-cl.lisp
2.1.9 datastar-cl/core/actions.lisp
2.1.10 datastar-cl/clack/clack.lisp
3 Packages
3.1 datastar-cl
4 Definitions
4.1 Public Interface
4.1.1 Special variables
4.1.2 Macros
4.1.3 Ordinary functions
4.1.4 Generic functions
4.1.5 Standalone methods
4.1.6 Conditions
4.2 Internals
4.2.1 Constants
4.2.2 Special variables
4.2.3 Macros
4.2.4 Ordinary functions
4.2.5 Generic functions
4.2.6 Classes
4.2.7 Types
Appendix A Indexes
A.1 Concepts
A.2 Functions
A.3 Variables
A.4 Data types
The datastar-cl Reference Manual
********************************
This is the datastar-cl Reference Manual, version 0.1.0.
1 Systems
*********
The main system appears first, followed by any subsystem dependency.
1.1 datastar-cl
===============
Common Lisp implementation of the Datastar SDK for Server-Sent Events
(SSE)
*Maintainer*
Frederico Muñoz <<[email protected]>>
*Author*
Frederico Muñoz <<[email protected]>>
*Home Page*
<https://github.com/fsmunoz/datastar-cl>
*License*
MIT
*Version*
0.1.0
*Dependencies*
• datastar-cl/hunchentoot: ❨1❩ (system).
• datastar-cl/clack: ❨3❩ (system).
*Source*
datastar-cl.asd: ❨4❩.
1.2 datastar-cl/hunchentoot
===========================
Datastar SDK: Hunchentoot backend
*Maintainer*
Frederico Muñoz <<[email protected]>>
*Author*
Frederico Muñoz <<[email protected]>>
*Home Page*
<https://github.com/fsmunoz/datastar-cl>
*License*
MIT
*Version*
0.1.0
*Dependencies*
• datastar-cl/core: ❨2❩ (system).
• hunchentoot (system).
*Source*
datastar-cl.asd: ❨4❩.
*Child Component*
hunchentoot.lisp: ❨5❩ (file).
1.3 datastar-cl/core
====================
Common Lisp Datastar SDK core
*Maintainer*
Frederico Muñoz <<[email protected]>>
*Author*
Frederico Muñoz <<[email protected]>>
*Home Page*
<https://github.com/fsmunoz/datastar-cl>
*License*
MIT
*Version*
0.1.0
*Dependencies*
• bordeaux-threads (system).
• split-sequence (system).
• alexandria (system).
• com.inuoe.jzon (system).
• quri (system).
• flexi-streams (system).
• trivial-gray-streams (system).
• zstd (system).
*Source*
datastar-cl.asd: ❨4❩.
*Child Components*
• package.lisp: ❨6❩ (file).
• conditions.lisp: ❨7❩ (file).
• config.lisp: ❨8❩ (file).
• compression.lisp: ❨9❩ (file).
• signals.lisp: ❨10❩ (file).
• datastar-cl.lisp: ❨11❩ (file).
• actions.lisp: ❨12❩ (file).
1.4 datastar-cl/clack
=====================
Datastar SDK: Clack backend
*Maintainer*
Frederico Muñoz <<[email protected]>>
*Author*
Frederico Muñoz <<[email protected]>>
*Home Page*
<https://github.com/fsmunoz/datastar-cl>
*License*
MIT
*Version*
0.1.0
*Dependencies*
• datastar-cl/core: ❨2❩ (system).
• clack (system).
• lack-util-writer-stream (system).
*Source*
datastar-cl.asd: ❨4❩.
*Child Component*
clack.lisp: ❨13❩ (file).
2 Files
*******
Files are sorted by type and then listed depth-first from the systems
components trees.
2.1 Lisp
========
2.1.1 datastar-cl/datastar-cl.asd
---------------------------------
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl: ❨0❩ (system).
*ASDF Systems*
• datastar-cl: ❨0❩.
• datastar-cl/hunchentoot: ❨1❩.
• datastar-cl/core: ❨2❩.
• datastar-cl/clack: ❨3❩.
2.1.2 datastar-cl/hunchentoot/hunchentoot.lisp
----------------------------------------------
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/hunchentoot: ❨1❩ (system).
*Public Interface*
• close-sse-generator: ❨133❩ (method).
• datastar-request-p: ❨144❩ (method).
• initialize-instance: ❨240❩ (method).
• make-hunchentoot-sse-generator: ❨115❩ (function).
• read-signals: ❨153❩ (method).
*Internals*
• extract-json-data: ❨82❩ (method).
• extract-json-data: ❨83❩ (method).
• extract-json-data: ❨84❩ (method).
• extract-json-data: ❨85❩ (method).
• extract-json-data: ❨86❩ (method).
• hunchentoot-sse-generator: ❨96❩ (class).
2.1.3 datastar-cl/core/package.lisp
-----------------------------------
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Packages*
datastar-cl: ❨14❩.
2.1.4 datastar-cl/core/conditions.lisp
--------------------------------------
*Dependency*
package.lisp: ❨6❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Public Interface*
• compression-error: ❨169❩ (condition).
• datastar-error: ❨181❩ (condition).
• datastar-error-message: ❨123❩ (reader method).
• (setf datastar-error-message): ❨125❩ (writer method).
• invalid-json-error: ❨137❩ (condition).
• invalid-json-error-json-string: ❨184❩ (reader method).
• (setf invalid-json-error-json-string): ❨186❩ (writer method).
• signal-error: ❨161❩ (condition).
• sse-connection-lost: ❨139❩ (condition).
• sse-connection-lost-generator: ❨117❩ (reader method).
• (setf sse-connection-lost-generator): ❨119❩ (writer method).
• woo-error: ❨149❩ (condition).
2.1.5 datastar-cl/core/config.lisp
----------------------------------
*Dependency*
conditions.lisp: ❨7❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Public Interface*
• *catch-errors-p*: ❨167❩ (special variable).
• *default-auto-remove*: ❨155❩ (special variable).
• *default-compression-level*: ❨193❩ (special variable).
• *default-compression-priority*: ❨162❩ (special variable).
• *default-keep-alive-interval*: ❨196❩ (special variable).
• *default-namespace*: ❨128❩ (special variable).
• *default-patch-mode*: ❨150❩ (special variable).
• *default-retry-duration*: ❨188❩ (special variable).
• *woo-sse-debug*: ❨127❩ (special variable).
*Internals*
+event-types+: ❨88❩ (constant).
2.1.6 datastar-cl/core/compression.lisp
---------------------------------------
*Dependency*
config.lisp: ❨8❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Internals*
• make-compression-stream: ❨46❩ (function).
• select-compression-algorithm: ❨34❩ (function).
2.1.7 datastar-cl/core/signals.lisp
-----------------------------------
*Dependency*
compression.lisp: ❨9❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Public Interface*
• datastar-request-p: ❨142❩ (generic function).
• read-signal: ❨126❩ (function).
• read-signals: ❨151❩ (generic function).
*Internals*
• extract-json-data: ❨76❩ (generic function).
• parse-and-validate-json: ❨100❩ (function).
2.1.8 datastar-cl/core/datastar-cl.lisp
---------------------------------------
*Dependency*
signals.lisp: ❨10❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Public Interface*
• close-sse-generator: ❨132❩ (generic function).
• console-error: ❨135❩ (function).
• console-log: ❨189❩ (function).
• ensure-connection-open: ❨190❩ (generic function).
• execute-script: ❨194❩ (generic function).
• keep-sse-alive: ❨174❩ (generic function).
• make-sse-generator: ❨172❩ (function).
• notify-connection: ❨120❩ (generic function).
• patch-elements: ❨177❩ (generic function).
• patch-signals: ❨163❩ (generic function).
• redirect: ❨180❩ (function).
• remove-element: ❨146❩ (function).
• run-sse-loop: ❨130❩ (generic function).
• send-event: ❨158❩ (generic function).
• with-sse-connection: ❨148❩ (macro).
• with-sse-lock: ❨141❩ (macro).
• with-sse-response: ❨179❩ (macro).
*Internals*
• %kebab->camel: ❨65❩ (function).
• %plist-to-nested-hash-table: ❨91❩ (function).
• %set-signal-in: ❨39❩ (function).
• attributes: ❨22❩ (type).
• build-script-tag: ❨99❩ (function).
• compressed-stream: ❨107❩ (reader method).
• (setf compressed-stream): ❨109❩ (writer method).
• data-lines: ❨97❩ (type).
• event-id: ❨40❩ (type).
• event-type: ❨43❩ (type).
• event-type-wire-name: ❨89❩ (function).
• finish-output-before-flush: ❨57❩ (generic function).
• flush-sse-streams: ❨87❩ (function).
• generator-construction-form: ❨15❩ (function).
• ignore-teardown-errors: ❨90❩ (macro).
• lock: ❨32❩ (reader method).
• maybe-send-keepalive: ❨21❩ (function).
• namespace: ❨113❩ (type).
• namespace-p: ❨98❩ (function).
• patch-mode: ❨101❩ (type).
• patch-mode-p: ❨42❩ (function).
• prefix-data-lines: ❨114❩ (function).
• raw-stream: ❨48❩ (reader method).
• (setf raw-stream): ❨50❩ (writer method).
• request: ❨36❩ (reader method).
• (setf request): ❨38❩ (writer method).
• response: ❨61❩ (reader method).
• (setf response): ❨63❩ (writer method).
• retry-duration: ❨56❩ (type).
• sleep-body-interval: ❨29❩ (function).
• sse-generator: ❨66❩ (class).
2.1.9 datastar-cl/core/actions.lisp
-----------------------------------
*Dependency*
datastar-cl.lisp: ❨11❩ (file).
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/core: ❨2❩ (system).
*Public Interface*
• *datastar-cdn-base*: ❨171❩ (special variable).
• *datastar-source*: ❨187❩ (special variable).
• *datastar-version*: ❨129❩ (special variable).
• datastar-url: ❨136❩ (function).
• ds-expr: ❨145❩ (function).
• init-signals: ❨168❩ (function).
• sse-delete: ❨147❩ (function).
• sse-get: ❨157❩ (function).
• sse-patch: ❨197❩ (function).
• sse-post: ❨156❩ (function).
• sse-put: ❨170❩ (function).
*Internals*
• %js-object: ❨64❩ (function).
• %js-value: ❨28❩ (function).
• %sse-action: ❨41❩ (function).
2.1.10 datastar-cl/clack/clack.lisp
-----------------------------------
*Source*
datastar-cl.asd: ❨4❩.
*Parent Component*
datastar-cl/clack: ❨3❩ (system).
*Public Interface*
• close: ❨239❩ (method).
• datastar-request-p: ❨143❩ (method).
• ensure-connection-open: ❨191❩ (method).
• initialize-instance: ❨212❩ (method).
• initialize-instance: ❨241❩ (method).
• make-clack-sse-generator: ❨173❩ (function).
• read-signals: ❨152❩ (method).
• stream-finish-output: ❨237❩ (method).
• stream-force-output: ❨238❩ (method).
• stream-write-byte: ❨235❩ (method).
• stream-write-sequence: ❨236❩ (method).
*Internals*
• *woo-extension-warned-p*: ❨27❩ (special variable).
• buffer: ❨24❩ (reader method).
• (setf buffer): ❨26❩ (writer method).
• buffering-writer-stream: ❨92❩ (class).
• callback: ❨53❩ (reader method).
• (setf callback): ❨55❩ (writer method).
• clack-sse-generator: ❨110❩ (class).
• detect-clack-backend-type: ❨51❩ (function).
• env: ❨17❩ (reader method).
• (setf env): ❨19❩ (writer method).
• extract-datastar-from-query: ❨33❩ (function).
• extract-json-data: ❨77❩ (method).
• extract-json-data: ❨78❩ (method).
• extract-json-data: ❨79❩ (method).
• extract-json-data: ❨80❩ (method).
• extract-json-data: ❨81❩ (method).
• finish-output-before-flush: ❨58❩ (method).
• get-clack-header: ❨95❩ (function).
• make-buffering-writer-stream: ❨30❩ (function).
• responder: ❨103❩ (reader method).
• (setf responder): ❨105❩ (writer method).
• woo-extension-loaded-p: ❨20❩ (function).
• woo-generator-evloop: ❨73❩ (reader method).
• (setf woo-generator-evloop): ❨75❩ (writer method).
• woo-sse-generator: ❨44❩ (class).
3 Packages
**********
Packages are listed by definition order.
3.1 datastar-cl
===============
*Source*
package.lisp: ❨6❩.
*Use List*
common-lisp.
*Public Interface*
• *catch-errors-p*: ❨167❩ (special variable).
• *datastar-cdn-base*: ❨171❩ (special variable).
• *datastar-source*: ❨187❩ (special variable).
• *datastar-version*: ❨129❩ (special variable).
• *default-auto-remove*: ❨155❩ (special variable).
• *default-compression-level*: ❨193❩ (special variable).
• *default-compression-priority*: ❨162❩ (special variable).
• *default-keep-alive-interval*: ❨196❩ (special variable).
• *default-namespace*: ❨128❩ (special variable).
• *default-patch-mode*: ❨150❩ (special variable).
• *default-retry-duration*: ❨188❩ (special variable).
• *woo-sse-debug*: ❨127❩ (special variable).
• close-sse-generator: ❨132❩ (generic function).
• compression-error: ❨169❩ (condition).
• console-error: ❨135❩ (function).
• console-log: ❨189❩ (function).
• datastar-error: ❨181❩ (condition).
• datastar-error-message: ❨122❩ (generic reader).
• (setf datastar-error-message): ❨124❩ (generic writer).
• datastar-request-p: ❨142❩ (generic function).
• datastar-url: ❨136❩ (function).
• ds-expr: ❨145❩ (function).
• ensure-connection-open: ❨190❩ (generic function).
• execute-script: ❨194❩ (generic function).
• init-signals: ❨168❩ (function).
• invalid-json-error: ❨137❩ (condition).
• invalid-json-error-json-string: ❨183❩ (generic reader).
• (setf invalid-json-error-json-string): ❨185❩ (generic writer).
• keep-sse-alive: ❨174❩ (generic function).
• make-clack-sse-generator: ❨173❩ (function).
• make-hunchentoot-sse-generator: ❨115❩ (function).
• make-sse-generator: ❨172❩ (function).
• notify-connection: ❨120❩ (generic function).
• patch-elements: ❨177❩ (generic function).
• patch-signals: ❨163❩ (generic function).
• read-signal: ❨126❩ (function).
• read-signals: ❨151❩ (generic function).
• redirect: ❨180❩ (function).
• remove-element: ❨146❩ (function).
• run-sse-loop: ❨130❩ (generic function).
• send-event: ❨158❩ (generic function).
• signal-error: ❨161❩ (condition).
• sse-connection-lost: ❨139❩ (condition).
• sse-connection-lost-generator: ❨116❩ (generic reader).
• (setf sse-connection-lost-generator): ❨118❩ (generic writer).
• sse-delete: ❨147❩ (function).
• sse-get: ❨157❩ (function).
• sse-patch: ❨197❩ (function).
• sse-post: ❨156❩ (function).
• sse-put: ❨170❩ (function).
• with-sse-connection: ❨148❩ (macro).
• with-sse-lock: ❨141❩ (macro).
• with-sse-response: ❨179❩ (macro).
• woo-error: ❨149❩ (condition).
*Internals*
• %js-object: ❨64❩ (function).
• %js-value: ❨28❩ (function).
• %kebab->camel: ❨65❩ (function).
• %plist-to-nested-hash-table: ❨91❩ (function).
• %set-signal-in: ❨39❩ (function).
• %sse-action: ❨41❩ (function).
• *woo-extension-warned-p*: ❨27❩ (special variable).
• +event-types+: ❨88❩ (constant).
• attributes: ❨22❩ (type).
• buffer: ❨23❩ (generic reader).
• (setf buffer): ❨25❩ (generic writer).
• buffering-writer-stream: ❨92❩ (class).
• build-script-tag: ❨99❩ (function).
• callback: ❨52❩ (generic reader).
• (setf callback): ❨54❩ (generic writer).
• clack-sse-generator: ❨110❩ (class).
• compressed-stream: ❨106❩ (generic reader).
• (setf compressed-stream): ❨108❩ (generic writer).
• data-lines: ❨97❩ (type).
• detect-clack-backend-type: ❨51❩ (function).
• env: ❨16❩ (generic reader).
• (setf env): ❨18❩ (generic writer).
• event-id: ❨40❩ (type).
• event-type: ❨43❩ (type).
• event-type-wire-name: ❨89❩ (function).
• extract-datastar-from-query: ❨33❩ (function).
• extract-json-data: ❨76❩ (generic function).
• finish-output-before-flush: ❨57❩ (generic function).
• flush-sse-streams: ❨87❩ (function).
• generator-construction-form: ❨15❩ (function).
• get-clack-header: ❨95❩ (function).
• hunchentoot-sse-generator: ❨96❩ (class).
• ignore-teardown-errors: ❨90❩ (macro).
• lock: ❨31❩ (generic reader).
• make-buffering-writer-stream: ❨30❩ (function).
• make-compression-stream: ❨46❩ (function).
• maybe-send-keepalive: ❨21❩ (function).
• namespace: ❨113❩ (type).
• namespace-p: ❨98❩ (function).
• parse-and-validate-json: ❨100❩ (function).
• patch-mode: ❨101❩ (type).
• patch-mode-p: ❨42❩ (function).
• prefix-data-lines: ❨114❩ (function).
• raw-stream: ❨47❩ (generic reader).
• (setf raw-stream): ❨49❩ (generic writer).
• request: ❨35❩ (generic reader).
• (setf request): ❨37❩ (generic writer).
• responder: ❨102❩ (generic reader).
• (setf responder): ❨104❩ (generic writer).
• response: ❨60❩ (generic reader).
• (setf response): ❨62❩ (generic writer).
• retry-duration: ❨56❩ (type).
• select-compression-algorithm: ❨34❩ (function).
• sleep-body-interval: ❨29❩ (function).
• sse-generator: ❨66❩ (class).
• woo-extension-loaded-p: ❨20❩ (function).
• woo-generator-evloop: ❨72❩ (generic reader).
• (setf woo-generator-evloop): ❨74❩ (generic writer).
• woo-sse-generator: ❨44❩ (class).
4 Definitions
*************
Definitions are sorted by export status, category, package, and then by
lexicographic order.
4.1 Public Interface
====================
4.1.1 Special variables
-----------------------
-- Special Variable: *catch-errors-p*
Controls error handling in READ-SIGNALS only.
When T: Catches DATASTAR-ERROR conditions, logs to *ERROR-OUTPUT*,
and returns NIL. Suitable for production.
When NIL (default): Errors propagate to debugger. Suitable for
development.
NOTE: Does NOT affect SSE sending methods (SEND-EVENT, PATCH-*,
EXECUTE-SCRIPT). Stream errors from those methods always
propagate, following CL conventions. Does NOT affect
WITH-SSE-CONNECTION error handling, which always catches connection
lifecycle errors for proper cleanup.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *datastar-cdn-base*
Base CDN URL for Datastar bundles; override to point at a mirror or
private CDN.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Special Variable: *datastar-source*
If non-NIL, a string used verbatim as the Datastar script src (e.g.
"/static/datastar.js" or a custom URL). If NIL, DATASTAR-URL builds
a URL from *DATASTAR-CDN-BASE* and *DATASTAR-VERSION*.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Special Variable: *datastar-version*
Default Datastar JS library version used by DATASTAR-URL.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Special Variable: *default-auto-remove*
Default auto remove for script execution.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-compression-level*
Default compression level for zstd and brotli streams.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-compression-priority*
Default priority order for compression algorithm selection.
Only include implemented algorithms. Per RFC 7231 Section 5.3.4,
if none of the client's acceptable encodings are supported, respond
without compression.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-keep-alive-interval*
Default keep-alive interval in seconds for SSE connections.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-namespace*
Default element namespace for patch-elements (:html / :svg /
:mathml).
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-patch-mode*
Default element patch mode.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *default-retry-duration*
Reconnection delay after connection loss (milliseconds).
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
-- Special Variable: *woo-sse-debug*
When T, log all Woo SSE errors including expected disconnections.
Meaningful only when datastar-cl/woo is loaded; always NIL
otherwise.
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
4.1.2 Macros
------------
-- Macro: with-sse-connection ((generator-var request-or-env-responder
&key keep-alive-interval body-interval on-connect
on-disconnect on-exception) &body body)
Maintain a long-lived SSE connection while executing BODY in a
loop.
Use this for streaming updates, real-time push, or any connection
that stays open indefinitely. For one-shot responses, see
WITH-SSE-RESPONSE.
Backend dispatch is automatic:
- Pass a single request object for Hunchentoot.
- Pass an (env responder) list for Clack.
- When the Clack backend is Woo and datastar-cl/woo is loaded,
the connection uses libev timers and the handler returns
immediately, freeing the Woo worker. Otherwise a blocking loop is
used.
Keywords:
:KEEP-ALIVE-INTERVAL - Seconds between keep-alive pings (default
30);
NIL disables keep-alive.
:BODY-INTERVAL - Seconds between body executions (default 0).
:ON-CONNECT - Called with the generator when the connection opens.
:ON-DISCONNECT - Called with the generator and error on close.
:ON-EXCEPTION - Called as (fn generator condition) on generic ERROR
conditions in the body. Return NIL to resume the loop; return
truthy (the default) to close the connection. Connection-level
errors (end-of-file, stream-error) always disconnect regardless of
this callback.
Examples:
(with-sse-connection (gen hunchentoot:*request*
:keep-alive-interval 30
:body-interval 10)
(patch-signals gen (get-current-data)))
(with-sse-connection (gen (env responder)
:on-connect #'log-connection
:on-disconnect #'log-disconnection) (stream-notifications gen))
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Macro: with-sse-lock ((generator) &body body)
Hold the GENERATOR's send lock while executing BODY.
Use to serialize a batch of sends as one atomic group, preventing
other threads from interleaving events; the lock is recursive, to
avoid a SEND-EVENT and KEEP-SSE-ALIVE calls inside BODY deadlock.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Macro: with-sse-response ((generator-var request-or-env-responder)
&body body)
Execute BODY once with an SSE generator, then close connection.
Use for ONE-SHOT responses (connection closes after sending):
- Form submission responses
- Single action responses
- Polling endpoints (client polls, server responds once)
For LONG-LIVED streaming (connection stays open), use
WITH-SSE-CONNECTION.
Backend auto-detection (same pattern as WITH-SSE-CONNECTION):
- Hunchentoot: pass single request object
- Clack: pass (env responder) list
Arguments:
GENERATOR-VAR: Symbol to bind the sse-generator to (used in the
body) REQUEST-OR-ENV-RESPONDER: Either a single request
(Hunchentoot)
or (env responder) list (Clack)
BODY executes once, connection closes when handler returns.
Examples:
;; Hunchentoot
(with-sse-response (gen hunchentoot:*request*)
(patch-signals gen (process-data)))
;; Clack polling endpoint
(with-sse-response (gen (env responder))
(funcall updater gen))
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
4.1.3 Ordinary functions
------------------------
-- Function: console-error (generator message &key event-id
retry-duration)
Emit a console.error call in the browser via EXECUTE-SCRIPT.
MESSAGE is JSON-encoded to produce a safe JS string literal.
Convenience wrapper; not an extension point (specialize
EXECUTE-SCRIPT instead).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: console-log (generator message &key event-id
retry-duration)
Emit a console.log call in the browser via EXECUTE-SCRIPT.
MESSAGE is JSON-encoded to produce a safe JS string literal.
Convenience wrapper; not an extension point (specialize
EXECUTE-SCRIPT instead).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: datastar-url (&key version cdn-base source)
Return the URL or path from which to load the Datastar JS library.
If SOURCE is non-NIL it is returned verbatim; otherwise a jsDelivr
CDN URL is built from CDN-BASE and VERSION.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: ds-expr (&rest parts)
Builds a Datastar-ready string from many individual statements in
PARTS.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: init-signals (&rest plist)
Build a data-signals JSON string from a PLIST of key/value pairs.
See %plist-to-nested-hash-table for key handling. Values follow
JZON encoding: NIL -> false, T -> true, the symbol CL:NULL ('null)
-> null.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: make-clack-sse-generator (env responder &key
disable-compression compression-level compression-priority)
Create appropriate Clack SSE generator based on detected backend
with optional compression settings.
Automatically selects woo-sse-generator for Woo, or the generic
clack-sse-generator for others.
Keywords:
:disable-compression - When T, disable compression even if client
supports it :compression-level - Compression level (default 3 for
zstd, 6 for gzip) :compression-priority - List of algorithms in
preference order
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
-- Function: make-hunchentoot-sse-generator (request &key
disable-compression compression-level compression-priority)
Create a Hunchentoot SSE generator with REQUEST and optional
compression settings.
Keywords:
:disable-compression - When T, disable compression even if client
supports it :compression-level - Compression level (default 3 for
zstd, 6 for gzip) :compression-priority - List of algorithms in
preference order
*Package*
datastar-cl: ❨14❩.
*Source*
hunchentoot.lisp: ❨5❩.
-- Function: make-sse-generator (request-or-env &optional responder
&key disable-compression compression-level
compression-priority)
Create an SSE generator, dispatching on backend automatically.
Single positional argument: Hunchentoot (pass
hunchentoot:*request*). Two positional arguments: Clack (pass env
and responder callback).
Accepts the same keyword arguments as the backend-specific
constructors. For explicit backend control, use
MAKE-HUNCHENTOOT-SSE-GENERATOR or MAKE-CLACK-SSE-GENERATOR
directly.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: read-signal (request-or-env key &optional default)
Read a single Datastar signal KEY (a string, e.g. "sid") from
REQUEST-OR-ENV.
Returns (values value reason):
VALUE - the signal value, or DEFAULT when signals are absent or KEY
is not found. DEFAULT is NIL when not specified.
REASON - propagated from READ-SIGNALS (NIL normally, or the
DATASTAR-ERROR condition when a parse error was swallowed).
NIL-safe: if READ-SIGNALS returns NIL, returns (values DEFAULT
reason). For reading several signals, call READ-SIGNALS once and
use GETHASH to avoid re-parsing.
*Package*
datastar-cl: ❨14❩.
*Source*
signals.lisp: ❨10❩.
-- Function: redirect (generator url &key event-id retry-duration)
Redirect the browser to URL via EXECUTE-SCRIPT.
URL is JSON-encoded to produce a safe JS string literal.
Convenience wrapper; not an extension point (specialize
EXECUTE-SCRIPT instead).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: remove-element (generator selector &key
use-view-transition event-id retry-duration)
Remove element(s) matching SELECTOR from the DOM.
Convenience wrapper around PATCH-ELEMENTS with mode "remove"; not
an extension point.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: sse-delete (url &optional opts)
Build a Datastar @delete(...) action expression for use in HTML
attributes. OPTS is a raw JS object literal string or a plist.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: sse-get (url &optional opts)
Build a Datastar @get(...) action expression for use in HTML
attributes. OPTS is a raw JS object literal string or a plist,
e.g.:
(sse-get "/ep" '(:open-when-hidden t :content-type :form))
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: sse-patch (url &optional opts)
Build a Datastar @patch(...) action expression for use in HTML
attributes. OPTS is a raw JS object literal string or a plist.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: sse-post (url &optional opts)
Build a Datastar @post(...) action expression for use in HTML
attributes. OPTS is a raw JS object literal string or a plist,
e.g.:
(sse-post "/ep" '(:headers (("X-Csrf-Token" . "tok"))))
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: sse-put (url &optional opts)
Build a Datastar @put(...) action expression for use in HTML
attributes. OPTS is a raw JS object literal string or a plist.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
4.1.4 Generic functions
-----------------------
-- Generic Function: close-sse-generator (generator)
Close the SSE generator's response stream.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: close-sse-generator ((generator
hunchentoot-sse-generator: ❨96❩))
Close SSE generator for Hunchentoot.
Closes the compression stream to emit final frame, but
only flushes the socket since Hunchentoot manages the
socket lifecycle itself.
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: close-sse-generator ((generator sse-generator:
❨66❩))
Default close sequence for the full stream stack:
finish-output and close the response (UTF-8/flexi)
stream, finish-output and close the compression stream
(emitting its end-of-stream marker), then close the raw
stream so the backend's writer callback receives its
close signal.
This default serves the Clack and Woo backends.
Hunchentoot specialises this method because it owns and
manages its socket directly.
See COMPRESSION.org for the zstd/brotli flush-vs-close
invariants.
-- Generic Reader: datastar-error-message (condition)
-- Generic Writer: (setf datastar-error-message) (condition)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: datastar-error-message ((condition
datastar-error: ❨181❩))
-- Writer Method: (setf datastar-error-message) ((condition
datastar-error: ❨181❩))
*Source*
conditions.lisp: ❨7❩.
*Target Slot*
message: ❨182❩.
-- Generic Function: datastar-request-p (request-or-env)
Return T if REQUEST-OR-ENV originates from the Datastar client.
The Datastar JS client marks every request with a Datastar-Request:
true header.
*Package*
datastar-cl: ❨14❩.
*Source*
signals.lisp: ❨10❩.
*Methods*
-- Method: datastar-request-p ((env list))
*Source*
clack.lisp: ❨13❩.
-- Method: datastar-request-p ((request request))
*Source*
hunchentoot.lisp: ❨5❩.
-- Generic Function: ensure-connection-open (generator)
Verify SSE connection is still open. Signals error if closed.
Default behavior: do nothing (rely on stream I/O to detect errors
naturally). Non-Woo Clack backends use this default: they
propagate socket closure as stream errors, so no proactive check is
needed. Woo requires an explicit socket-state probe and
specialises this method on WOO-SSE-GENERATOR.
Signals: SSE-CONNECTION-LOST if connection is detected as closed.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: ensure-connection-open ((generator
woo-sse-generator: ❨44❩))
Proactively check Woo socket state.
Woo doesn't seem to propagate socket closure as CL
conditions, so we check the socket state explicitly
before I/O operations.
*Source*
clack.lisp: ❨13❩.
-- Method: ensure-connection-open ((generator sse-generator:
❨66❩))
Default implementation: no proactive checking.
Stream errors will be caught naturally during I/O
operations.
-- Generic Function: execute-script (generator script &key auto-remove
attributes event-id retry-duration)
Send a SCRIPT to the client for immediate execution via SSE.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: execute-script ((generator sse-generator: ❨66❩)
(script string) &key auto-remove attributes event-id
retry-duration)
Execute a script on the client side via DOM injection.
Signals: STREAM-ERROR if SSE transmission fails (via
PATCH-ELEMENTS).
-- Generic Reader: invalid-json-error-json-string (condition)
-- Generic Writer: (setf invalid-json-error-json-string) (condition)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: invalid-json-error-json-string ((condition
invalid-json-error: ❨137❩))
-- Writer Method: (setf invalid-json-error-json-string)
((condition invalid-json-error: ❨137❩))
*Source*
conditions.lisp: ❨7❩.
*Target Slot*
json-string: ❨138❩.
-- Generic Function: keep-sse-alive (generator)
Send keep-alive through SSE stream.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: keep-sse-alive :before ((generator sse-generator:
❨66❩))
Check connection health before sending a keep-alive.
Mirrors SEND-EVENT :BEFORE; ENSURE-CONNECTION-OPEN
dispatches per backend.
-- Method: keep-sse-alive ((generator sse-generator: ❨66❩))
Send keep-alive SSE comment. Thread-safe; dispatches to
FINISH-OUTPUT-BEFORE-FLUSH for backend-specific response
stream handling before flushing.
-- Generic Function: notify-connection (generator action)
Schedule ACTION (a function of one argument, the generator) to run
in the generator's safe-write context.
Use this from short-lived handlers (e.g. POST/commands) to push
writes into a long-lived SSE generator that is owned by a different
handler (e.g. GET/reads): this is the primitive that makes CQRS
possible across backends.
Default method: funcalls (ACTION GENERATOR) in the calling thread.
Stream writes inside the action are serialized by the generator
lock (held inside SEND-EVENT), so this is safe for Hunchentoot and
for
"plain" Clack backends where any thread may write to the stream.
The WOO-SSE-GENERATOR specialisation reroutes the action via a
(custom ) ev_async apporach to run in the generator's evloop
worker, because Woo's streams cannot be written to from a
non-owning worker thread.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: notify-connection ((generator sse-generator: ❨66❩)
action)
Default: funcall action in the calling thread.
Stream writes inside the action are lock-protected by
SEND-EVENT.
-- Generic Function: patch-elements (generator elements &key selector
mode namespace use-view-transition event-id retry-duration)
Patch HTML ELEMENTS into the DOM using SSE.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: patch-elements ((generator sse-generator: ❨66❩)
elements &key selector mode namespace
use-view-transition event-id retry-duration)
Patch HTML elements into the DOM.
ELEMENTS can be a string of HTML or NIL to send only
mode/selector/transition data.
Signals: STREAM-ERROR if SSE transmission fails (via
SEND-EVENT).
-- Generic Function: patch-signals (generator signals &key
only-if-missing event-id retry-duration)
Patch SIGNALS into the DOM using SSE.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: patch-signals ((generator sse-generator: ❨66❩)
(signals list) &key only-if-missing event-id
retry-duration)
Patch signals from a plist; see
%plist-to-nested-hash-table for key handling.
-- Method: patch-signals ((generator sse-generator: ❨66❩)
(signals hash-table) &key only-if-missing event-id
retry-duration)
Patch signals from a hash-table: serialize to JSON and
delegate to the string method (the canonical patch path).
-- Method: patch-signals ((generator sse-generator: ❨66❩)
(signals string) &key only-if-missing event-id
retry-duration)
Patch signals from JSON string into the DOM.
Signals: STREAM-ERROR if SSE transmission fails (via
SEND-EVENT).
-- Generic Function: read-signals (request-or-env &key catch-errors)
Extract and parse Datastar signals from an HTTP request.
Returns (values signals reason):
SIGNALS - the parsed hash-table, or NIL if no payload or on error.
REASON - NIL normally; the DATASTAR-ERROR condition when
CATCH-ERRORS "swallows" a parse failure.
(values nil nil) = no datastar payload present.
(values nil c ) = parse error swallowed (CATCH-ERRORS was true).
(values ht nil) = parsed signals hash-table.
Signals INVALID-JSON-ERROR if JSON parsing fails and CATCH-ERRORS
is NIL. The CATCH-ERRORS policy (default *CATCH-ERRORS-P*) is
implemented in the :around method (for all backends); primary
methods perform raw extraction only.
*Package*
datastar-cl: ❨14❩.
*Source*
signals.lisp: ❨10❩.
*Methods*
-- Method: read-signals ((env list) &key catch-errors)
Extract raw signals from a Clack env. Error policy lives
in the :around method defined in datastar-cl.lisp.
*Source*
clack.lisp: ❨13❩.
-- Method: read-signals ((request request) &key catch-errors)
Extract raw signals from a Hunchentoot request. Error
policy lives in the :around method defined in
datastar-cl.lisp.
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: read-signals :around (request-or-env &key
catch-errors)
Uniform catch-errors policy for all read-signals methods.
When CATCH-ERRORS, caputures DATASTAR-ERROR and returns
(values NIL condition), otherwise the error propagates;
on success returns (values <hash-or-nil> NIL).
-- Generic Function: run-sse-loop (generator body-function &key
keep-alive-interval body-interval on-connect on-disconnect
on-exception)
Drive the SSE loop for GENERATOR calling BODY-FUNCTION
periodically.
The default method runs a blocking loop suitable for Hunchentoot
and
non-Woo Clack backends. The Woo-specific method in woo.lisp uses
libev timers and returns immediately, freeing the worker thread.
ON-EXCEPTION, if provided, is called as (funcall on-exception
generator condition) for generic ERROR conditions in the body.
Returning NIL resumes the loop; returning a truthy value (the
default when no callback is provided) disconnects.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: run-sse-loop ((generator sse-generator: ❨66❩)
body-function &key keep-alive-interval body-interval
on-connect on-disconnect on-exception)
Blocking SSE loop for Hunchentoot and non-Woo Clack
backends.
Runs in the calling thread; closes the generator on
normal exit or error. ON-EXCEPTION: optional (fn
generator condition) called on generic errors; returning
NIL resumes the loop, truthy disconnects (same as no
callback).
-- Generic Function: send-event (generator event-type data-lines &key
event-id retry-duration)
Send a Server-Sent Event through the GENERATOR.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: send-event ((generator sse-generator: ❨66❩)
event-type data-lines &key event-id retry-duration)
Send an SSE event with thread safety.
Signals: STREAM-ERROR if the response stream is closed or
writing fails. This is standard CL behavior - no
wrapping is performed.
-- Method: send-event :before ((generator sse-generator:
❨66❩) event-type data-lines &key event-id
retry-duration)
Check connection health before sending SSE event.
-- Generic Reader: sse-connection-lost-generator (condition)
-- Generic Writer: (setf sse-connection-lost-generator) (condition)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: sse-connection-lost-generator ((condition
sse-connection-lost: ❨139❩))
-- Writer Method: (setf sse-connection-lost-generator)
((condition sse-connection-lost: ❨139❩))
*Source*
conditions.lisp: ❨7❩.
*Target Slot*
generator: ❨140❩.
4.1.5 Standalone methods
------------------------
-- Method: close ((stream buffering-writer-stream: ❨92❩) &key abort)
*Source*
clack.lisp: ❨13❩.
-- Method: initialize-instance :after ((generator woo-sse-generator:
❨44❩) &key &allow-other-keys)
Capture the current evloop pointer from woo.ev:*evloop*.
Called in worker context immediately after the generator is
constructed, so the captured pointer is the one that owns this
generator's stream.
*Source*
clack.lisp: ❨13❩.
-- Method: initialize-instance :after ((generator
hunchentoot-sse-generator: ❨96❩) &key request
disable-compression compression-level compression-priority
&allow-other-keys)
Set up SSE headers and response stream for Hunchentoot with
optional compression.
Keywords:
:disable-compression - When T, disable compression even if client
supports it
:compression-level - Compression level (default 3 for zstd)
:compression-priority - List of algorithms in preference order
(default *default-compression-priority*)
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: initialize-instance :after ((generator clack-sse-generator:
❨110❩) &key env responder disable-compression
compression-level compression-priority &allow-other-keys)
Set up SSE headers and response stream for Clack with optional
compression.
*Source*
clack.lisp: ❨13❩.
-- Method: stream-finish-output ((stream buffering-writer-stream:
❨92❩))
Flush buffer to callback as a single chunk.
*Package*
sb-gray.
*Source*
clack.lisp: ❨13❩.
-- Method: stream-force-output ((stream buffering-writer-stream: ❨92❩))
*Package*
sb-gray.
*Source*
clack.lisp: ❨13❩.
-- Method: stream-write-byte ((stream buffering-writer-stream: ❨92❩)
byte)
*Package*
sb-gray.
*Source*
clack.lisp: ❨13❩.
-- Method: stream-write-sequence ((stream buffering-writer-stream:
❨92❩) sequence start end &key)
*Package*
trivial-gray-streams.
*Source*
clack.lisp: ❨13❩.
4.1.6 Conditions
----------------
-- Condition: compression-error
Signaled when a compression algorithm is not available or not
implemented.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
datastar-error: ❨181❩.
-- Condition: datastar-error
Base condition for datastar-cl errors.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
error.
*Direct subclasses*
• compression-error: ❨169❩.
• signal-error: ❨161❩.
• sse-connection-lost: ❨139❩.
• woo-error: ❨149❩.
*Direct methods*
• datastar-error-message: ❨123❩.
• (setf datastar-error-message): ❨125❩.
*Direct slots*
-- Slot: message
Human-readable error message.
*Initform*
(quote nil)
*Initargs*
:message
*Readers*
datastar-error-message: ❨123❩.
*Writers*
(setf datastar-error-message): ❨125❩.
-- Condition: invalid-json-error
Signaled when JSON parsing fails.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
signal-error: ❨161❩.
*Direct methods*
• invalid-json-error-json-string: ❨184❩.
• (setf invalid-json-error-json-string): ❨186❩.
*Direct slots*
-- Slot: json-string
The invalid JSON string.
*Initargs*
:json-string
*Readers*
invalid-json-error-json-string: ❨184❩.
*Writers*
(setf invalid-json-error-json-string): ❨186❩.
-- Condition: signal-error
Base condition for signal processing errors.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
datastar-error: ❨181❩.
*Direct subclasses*
invalid-json-error: ❨137❩.
-- Condition: sse-connection-lost
Signaled when SSE connection is detected as closed by client.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
• datastar-error: ❨181❩.
• stream-error.
*Direct methods*
• sse-connection-lost-generator: ❨117❩.
• (setf sse-connection-lost-generator): ❨119❩.
*Direct slots*
-- Slot: generator
The SSE generator with lost connection.
*Initargs*
:generator
*Readers*
sse-connection-lost-generator: ❨117❩.
*Writers*
(setf sse-connection-lost-generator): ❨119❩.
-- Condition: woo-error
Signaled when Woo async SSE setup fails.
*Package*
datastar-cl: ❨14❩.
*Source*
conditions.lisp: ❨7❩.
*Direct superclasses*
datastar-error: ❨181❩.
4.2 Internals
=============
4.2.1 Constants
---------------
-- Constant: +event-types+
Supported event types
*Package*
datastar-cl: ❨14❩.
*Source*
config.lisp: ❨8❩.
4.2.2 Special variables
-----------------------
-- Special Variable: *woo-extension-warned-p*
Set to T after the one-shot warning about a missing
:datastar-cl/woo load has fired. Prevents the same message from
appearing on every SSE generator construction.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
4.2.3 Macros
------------
-- Macro: ignore-teardown-errors (&body body)
Execute BODY suppressing all errors. For stream teardown paths
where
errors are expected: the remote end may already be closed, or the
stream may be in an undefined state after disconnection (happens
frequently in SSE, whenever s browser tab loses focus for example).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
4.2.4 Ordinary functions
------------------------
-- Function: %js-object (plist)
Serialise a plist to a JavaScript object literal string.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: %js-value (value)
Serialise a Lisp VALUE to a JavaScript literal string fragment.
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: %kebab->camel (string)
Convert a kebab-case STRING to camelCase (e.g. "selected-planet"
-> "selectedPlanet").
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: %plist-to-nested-hash-table (plist)
Convert a raw PLIST to a nested hash-table, normalizing keys:
symbol keys are kebab->camel cased (:show-details ->
"showDetails"); string keys pass through and may use dot-notation
to nest
("glitch.active" -> {"glitch":{"active":...}}).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: %set-signal-in (hash-table path value)
Set VALUE in nested HASH-TABLE following dot-notated PATH string
("glitch.active" nests under "glitch").
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: %sse-action (verb url &optional opts)
*Package*
datastar-cl: ❨14❩.
*Source*
actions.lisp: ❨12❩.
-- Function: build-script-tag (script &key attributes auto-remove)
Build HTML <script> tag string with optional ATTRIBUTES and
AUTO-REMOVE behavior. ATTRIBUTES is a hash-table (how it gets
here: JZON parses the JSON object {"k":"v",...}) or a plist for
direct Lisp callers, e.g. '(:type "text/javascript").
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: detect-clack-backend-type (env)
Detect the Clack backend type from ENV and return appropriate class
symbol. Returns 'woo-sse-generator for Woo backend,
'clack-sse-generator otherwise.
Also emits a one-shot warning when a Woo socket is found but
:datastar-cl/woo has not been loaded: without the extension the SSE
loop blocks the Woo evloop and notify-connection writes to Woo
streams from the wrong thread.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
-- Function: event-type-wire-name (event-type)
Returns the on-the-wire version of EVENT-TYPE, a keyword. Uses
*EVENT-TYPES*.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: extract-datastar-from-query (query-string)
Extract and URL-decode the datastar parameter from a query string.
Handles multi-param query strings and percent-encoding correctly.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
-- Function: flush-sse-streams (generator)
Flush compression and network layers of GENERATOR's stream stack.
Whether to also finish-output the response stream is the caller's
decision: lack/util/writer-stream (used by Clack without
compression) closes on finish-output.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: generator-construction-form (request-or-env-responder)
Return the MAKE-SSE-GENERATOR call form for the right backend at
macroexpansion time.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: get-clack-header (env header-name)
Extract header value from Clack ENV plist.
Clack stores headers in a hash-table at :HEADERS with lowercase
string keys. HEADER-NAME can be a string or keyword like
'accept-encoding' or :accept-encoding.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
-- Function: make-buffering-writer-stream (callback)
Create a buffering writer stream wrapping CALLBACK.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
-- Function: make-compression-stream (algorithm raw-stream level)
Create a compression stream for ALGORITHM wrapping RAW-STREAM.
Returns compression stream or signals error if algorithm is not
supported.
ALGORITHM: Keyword like :zstd or :gzip RAW-STREAM: The underlying
binary stream to wrap LEVEL: Compression level (algorithm-specific)
*Package*
datastar-cl: ❨14❩.
*Source*
compression.lisp: ❨9❩.
-- Function: maybe-send-keepalive (generator keep-alive-interval
last-keepalive)
Send a keep-alive if KEEP-ALIVE-INTERVAL seconds have passed since
LAST-KEEPALIVE. Returns the updated universal-time timestamp.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: namespace-p (x)
True if X is a valid namespace name, nil otherwise.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: parse-and-validate-json (json-string)
Parse JSON-STRING and validate it's a hash-table (JSON object).
Returns hash-table or signals INVALID-JSON-ERROR.
Per ADR: ReadSignals must return error for invalid JSON.
*Package*
datastar-cl: ❨14❩.
*Source*
signals.lisp: ❨10❩.
-- Function: patch-mode-p (x)
True if X is a valid patch mode, nil otherwise.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: prefix-data-lines (prefix text)
Return a list of strings, one for each line of TEXT, each prefixed
with PREFIX.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: select-compression-algorithm (accept-encoding-header
priority-list)
Select compression algorithm from ACCEPT-ENCODING-HEADER based on
PRIORITY-LIST.
Returns (values algorithm-keyword found-p) where algorithm-keyword
is one of :zstd, :br, :gzip, etc., or NIL if no supported algorithm
is found.
ACCEPT-ENCODING-HEADER: String like 'gzip, deflate, br' or NIL
PRIORITY-LIST: List of keywords like (:zstd :br) in preference
order
*Package*
datastar-cl: ❨14❩.
*Source*
compression.lisp: ❨9❩.
-- Function: sleep-body-interval (body-interval)
Sleep BODY-INTERVAL seconds when positive.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Function: woo-extension-loaded-p ()
Return T if woo.lisp (the :datastar-cl/woo system) has been loaded.
Probed at runtime via find-symbol so :datastar-cl/clack has no
compile-time dependency on the extension - the same pattern used
for the brotli codec.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
4.2.5 Generic functions
-----------------------
-- Generic Reader: buffer (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: buffer ((buffering-writer-stream
buffering-writer-stream: ❨92❩))
automatically generated reader method
*Source*
clack.lisp: ❨13❩.
*Target Slot*
buffer: ❨93❩.
-- Generic Writer: (setf buffer) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Writer Method: (setf buffer) ((buffering-writer-stream
buffering-writer-stream: ❨92❩))
automatically generated writer method
*Source*
clack.lisp: ❨13❩.
*Target Slot*
buffer: ❨93❩.
-- Generic Reader: callback (object)
-- Generic Writer: (setf callback) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: callback ((buffering-writer-stream
buffering-writer-stream: ❨92❩))
-- Writer Method: (setf callback) ((buffering-writer-stream
buffering-writer-stream: ❨92❩))
The underlying writer callback function.
*Source*
clack.lisp: ❨13❩.
*Target Slot*
callback: ❨94❩.
-- Generic Reader: compressed-stream (object)
-- Generic Writer: (setf compressed-stream) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: compressed-stream ((sse-generator
sse-generator: ❨66❩))
-- Writer Method: (setf compressed-stream) ((sse-generator
sse-generator: ❨66❩))
The compressed stream (depending on the algorithm). NIL
if compression is disabled.
*Source*
datastar-cl.lisp: ❨11❩.
*Target Slot*
compressed-stream: ❨69❩.
-- Generic Reader: env (object)
-- Generic Writer: (setf env) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: env ((clack-sse-generator
clack-sse-generator: ❨110❩))
-- Writer Method: (setf env) ((clack-sse-generator
clack-sse-generator: ❨110❩))
The Clack environment hash-table.
*Source*
clack.lisp: ❨13❩.
*Target Slot*
env: ❨111❩.
-- Generic Function: extract-json-data (request method)
Extract raw JSON data from request based on HTTP method. Returns
string of JSON data or NIL if no data present. Signals conditions
for error cases (empty body, etc.).
*Package*
datastar-cl: ❨14❩.
*Source*
signals.lisp: ❨10❩.
*Methods*
-- Method: extract-json-data ((env list) (method (eql
:patch)))
*Source*
clack.lisp: ❨13❩.
-- Method: extract-json-data ((env list) (method (eql :put)))
*Source*
clack.lisp: ❨13❩.
-- Method: extract-json-data ((env list) (method (eql
:delete)))
*Source*
clack.lisp: ❨13❩.
-- Method: extract-json-data ((env list) (method (eql
:post)))
Extract JSON from Clack POST request body (binary
stream).
*Source*
clack.lisp: ❨13❩.
-- Method: extract-json-data ((env list) (method (eql :get)))
Extract JSON from Clack GET request query string.
*Source*
clack.lisp: ❨13❩.
-- Method: extract-json-data ((request request) (method (eql
:patch)))
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: extract-json-data ((request request) (method (eql
:put)))
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: extract-json-data ((request request) (method (eql
:delete)))
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: extract-json-data ((request request) (method (eql
:post)))
Extract JSON from Hunchentoot POST request body.
*Source*
hunchentoot.lisp: ❨5❩.
-- Method: extract-json-data ((request request) (method (eql
:get)))
Extract JSON from Hunchentoot GET request query string.
*Source*
hunchentoot.lisp: ❨5❩.
-- Generic Function: finish-output-before-flush (generator)
Called inside SEND-EVENT and KEEP-SSE-ALIVE to conditionally
finish-output the response stream before flushing the compression
and network layers. Backends override this to apply their own
rules about when finish-output is safe (e.g. Clack's lack
writer-stream closes the connection on finish-output unless
compression is active).
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Methods*
-- Method: finish-output-before-flush ((generator
clack-sse-generator: ❨110❩))
Clack: only finish-output the response stream when
compression is active. Without compression, the response
is a lack/util/writer-stream that closes the connection
on finish-output.
*Source*
clack.lisp: ❨13❩.
-- Method: finish-output-before-flush ((generator
sse-generator: ❨66❩))
Default: always safe to finish-output (Hunchentoot
flexi-stream).
-- Generic Reader: lock (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: lock ((sse-generator sse-generator: ❨66❩))
Thread safety lock for stream operations.
*Source*
datastar-cl.lisp: ❨11❩.
*Target Slot*
lock: ❨71❩.
-- Generic Reader: raw-stream (object)
-- Generic Writer: (setf raw-stream) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: raw-stream ((sse-generator sse-generator:
❨66❩))
-- Writer Method: (setf raw-stream) ((sse-generator
sse-generator: ❨66❩))
The underlying raw/base stream for final flushing.
*Source*
datastar-cl.lisp: ❨11❩.
*Target Slot*
raw-stream: ❨70❩.
-- Generic Reader: request (object)
-- Generic Writer: (setf request) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: request ((sse-generator sse-generator:
❨66❩))
-- Writer Method: (setf request) ((sse-generator
sse-generator: ❨66❩))
The HTTP request object.
*Source*
datastar-cl.lisp: ❨11❩.
*Target Slot*
request: ❨67❩.
-- Generic Reader: responder (object)
-- Generic Writer: (setf responder) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: responder ((clack-sse-generator
clack-sse-generator: ❨110❩))
-- Writer Method: (setf responder) ((clack-sse-generator
clack-sse-generator: ❨110❩))
The Clack response callback function.
*Source*
clack.lisp: ❨13❩.
*Target Slot*
responder: ❨112❩.
-- Generic Reader: response (object)
-- Generic Writer: (setf response) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: response ((sse-generator sse-generator:
❨66❩))
-- Writer Method: (setf response) ((sse-generator
sse-generator: ❨66❩))
The response stream (flexi-stream for UTF-8).
*Source*
datastar-cl.lisp: ❨11❩.
*Target Slot*
response: ❨68❩.
-- Generic Reader: woo-generator-evloop (object)
-- Generic Writer: (setf woo-generator-evloop) (object)
*Package*
datastar-cl: ❨14❩.
*Methods*
-- Reader Method: woo-generator-evloop ((woo-sse-generator
woo-sse-generator: ❨44❩))
-- Writer Method: (setf woo-generator-evloop)
((woo-sse-generator woo-sse-generator: ❨44❩))
The libev event loop pointer for this generator's worker.
Captured at construction time (always in worker context).
Used by NOTIFY-CONNECTION to dispatch actions via
ev_async.
*Source*
clack.lisp: ❨13❩.
*Target Slot*
evloop: ❨45❩.
4.2.6 Classes
-------------
-- Class: buffering-writer-stream
A buffering stream for compression output.
Collects all writes into a buffer and only sends when flushed.
This prevents fragmentation of compressed frames across HTTP
chunks.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
*Direct superclasses*
fundamental-binary-output-stream.
*Direct methods*
• buffer: ❨24❩.
• (setf buffer): ❨26❩.
• callback: ❨53❩.
• (setf callback): ❨55❩.
• close: ❨239❩.
• stream-finish-output: ❨237❩.
• stream-force-output: ❨238❩.
• stream-write-byte: ❨235❩.
• stream-write-sequence: ❨236❩.
*Direct slots*
-- Slot: buffer
*Type*
(vector (unsigned-byte 8))
*Initform*
(make-array 1024 :element-type (quote (unsigned-byte
8)) :adjustable t :fill-pointer 0)
*Readers*
buffer: ❨24❩.
*Writers*
(setf buffer): ❨26❩.
-- Slot: callback
The underlying writer callback function.
*Initargs*
:callback
*Readers*
callback: ❨53❩.
*Writers*
(setf callback): ❨55❩.
-- Class: clack-sse-generator
Clack-specific SSE generator implementation.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
*Direct superclasses*
sse-generator: ❨66❩.
*Direct subclasses*
woo-sse-generator: ❨44❩.
*Direct methods*
• env: ❨17❩.
• (setf env): ❨19❩.
• finish-output-before-flush: ❨58❩.
• initialize-instance: ❨241❩.
• responder: ❨103❩.
• (setf responder): ❨105❩.
*Direct slots*
-- Slot: env
The Clack environment hash-table.
*Initargs*
:env
*Readers*
env: ❨17❩.
*Writers*
(setf env): ❨19❩.
-- Slot: responder
The Clack response callback function.
*Initargs*
:responder
*Readers*
responder: ❨103❩.
*Writers*
(setf responder): ❨105❩.
-- Class: hunchentoot-sse-generator
Hunchentoot-specific SSE generator implementation.
*Package*
datastar-cl: ❨14❩.
*Source*
hunchentoot.lisp: ❨5❩.
*Direct superclasses*
sse-generator: ❨66❩.
*Direct methods*
• close-sse-generator: ❨133❩.
• initialize-instance: ❨240❩.
-- Class: sse-generator
Base class for Server-Sent Events generators.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
*Direct subclasses*
• clack-sse-generator: ❨110❩.
• hunchentoot-sse-generator: ❨96❩.
*Direct methods*
• close-sse-generator: ❨134❩.
• compressed-stream: ❨107❩.
• (setf compressed-stream): ❨109❩.
• ensure-connection-open: ❨192❩.
• execute-script: ❨195❩.
• finish-output-before-flush: ❨59❩.
• keep-sse-alive: ❨176❩.
• keep-sse-alive: ❨175❩.
• lock: ❨32❩.
• notify-connection: ❨121❩.
• patch-elements: ❨178❩.
• patch-signals: ❨166❩.
• patch-signals: ❨165❩.
• patch-signals: ❨164❩.
• raw-stream: ❨48❩.
• (setf raw-stream): ❨50❩.
• request: ❨36❩.
• (setf request): ❨38❩.
• response: ❨61❩.
• (setf response): ❨63❩.
• run-sse-loop: ❨131❩.
• send-event: ❨160❩.
• send-event: ❨159❩.
*Direct slots*
-- Slot: request
The HTTP request object.
*Initargs*
:request
*Readers*
request: ❨36❩.
*Writers*
(setf request): ❨38❩.
-- Slot: response
The response stream (flexi-stream for UTF-8).
*Type*
(or null stream)
*Initargs*
:response
*Readers*
response: ❨61❩.
*Writers*
(setf response): ❨63❩.
-- Slot: compressed-stream
The compressed stream (depending on the algorithm). NIL
if compression is disabled.
*Type*
(or null stream)
*Initargs*
:compressed-stream
*Readers*
compressed-stream: ❨107❩.
*Writers*
(setf compressed-stream): ❨109❩.
-- Slot: raw-stream
The underlying raw/base stream for final flushing.
*Type*
(or null stream)
*Initargs*
:raw-stream
*Readers*
raw-stream: ❨48❩.
*Writers*
(setf raw-stream): ❨50❩.
-- Slot: lock
Thread safety lock for stream operations.
*Initform*
(bordeaux-threads:make-recursive-lock)
*Readers*
lock: ❨32❩.
*Writers*
This slot is read-only.
-- Class: woo-sse-generator
Clack SSE generator specifically for Woo backend.
Woo requires special socket health checking since it doesn't
properly propagate socket closure as CL conditions.
*Package*
datastar-cl: ❨14❩.
*Source*
clack.lisp: ❨13❩.
*Direct superclasses*
clack-sse-generator: ❨110❩.
*Direct methods*
• ensure-connection-open: ❨191❩.
• initialize-instance: ❨212❩.
• woo-generator-evloop: ❨73❩.
• (setf woo-generator-evloop): ❨75❩.
*Direct slots*
-- Slot: evloop
The libev event loop pointer for this generator's worker.
Captured at construction time (always in worker context).
Used by NOTIFY-CONNECTION to dispatch actions via
ev_async.
*Readers*
woo-generator-evloop: ❨73❩.
*Writers*
(setf woo-generator-evloop): ❨75❩.
4.2.7 Types
-----------
-- Type: attributes ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: data-lines ()
List of strings to be sent as SSE data lines.
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: event-id ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: event-type ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: namespace ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: patch-mode ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
-- Type: retry-duration ()
*Package*
datastar-cl: ❨14❩.
*Source*
datastar-cl.lisp: ❨11❩.
Appendix A Indexes
******************
A.1 Concepts
============
A.2 Functions
=============
* Menu:
* (setf buffer): Private generic functions.
(line 1616)
* (setf buffer) <1>: Private generic functions.
(line 1620)
* (setf callback): Private generic functions.
(line 1628)
* (setf callback) <1>: Private generic functions.
(line 1634)
* (setf compressed-stream): Private generic functions.
(line 1642)
* (setf compressed-stream) <1>: Private generic functions.
(line 1648)
* (setf datastar-error-message): Public generic functions.
(line 941)
* (setf datastar-error-message) <1>: Public generic functions.
(line 947)
* (setf env): Private generic functions.
(line 1657)
* (setf env) <1>: Private generic functions.
(line 1663)
* (setf invalid-json-error-json-string): Public generic functions.
(line 1013)
* (setf invalid-json-error-json-string) <1>: Public generic functions.
(line 1019)
* (setf raw-stream): Private generic functions.
(line 1757)
* (setf raw-stream) <1>: Private generic functions.
(line 1763)
* (setf request): Private generic functions.
(line 1771)
* (setf request) <1>: Private generic functions.
(line 1777)
* (setf responder): Private generic functions.
(line 1785)
* (setf responder) <1>: Private generic functions.
(line 1791)
* (setf response): Private generic functions.
(line 1799)
* (setf response) <1>: Private generic functions.
(line 1805)
* (setf sse-connection-lost-generator): Public generic functions.
(line 1200)
* (setf sse-connection-lost-generator) <1>: Public generic functions.
(line 1206)
* (setf woo-generator-evloop): Private generic functions.
(line 1813)
* (setf woo-generator-evloop) <1>: Private generic functions.
(line 1819)
* %js-object: Private ordinary functions.
(line 1415)
* %js-value: Private ordinary functions.
(line 1421)
* %kebab->camel: Private ordinary functions.
(line 1427)
* %plist-to-nested-hash-table: Private ordinary functions.
(line 1434)
* %set-signal-in: Private ordinary functions.
(line 1444)
* %sse-action: Private ordinary functions.
(line 1451)
* buffer: Private generic functions.
(line 1605)
* buffer <1>: Private generic functions.
(line 1609)
* build-script-tag: Private ordinary functions.
(line 1456)
* callback: Private generic functions.
(line 1627)
* callback <1>: Private generic functions.
(line 1632)
* close: Public standalone methods.
(line 1216)
* close-sse-generator: Public generic functions.
(line 912)
* close-sse-generator <1>: Public generic functions.
(line 919)
* close-sse-generator <2>: Public generic functions.
(line 927)
* compressed-stream: Private generic functions.
(line 1641)
* compressed-stream <1>: Private generic functions.
(line 1646)
* console-error: Public ordinary functions.
(line 742)
* console-log: Public ordinary functions.
(line 752)
* datastar-error-message: Public generic functions.
(line 940)
* datastar-error-message <1>: Public generic functions.
(line 945)
* datastar-request-p: Public generic functions.
(line 953)
* datastar-request-p <1>: Public generic functions.
(line 962)
* datastar-request-p <2>: Public generic functions.
(line 965)
* datastar-url: Public ordinary functions.
(line 762)
* detect-clack-backend-type: Private ordinary functions.
(line 1465)
* ds-expr: Public ordinary functions.
(line 770)
* ensure-connection-open: Public generic functions.
(line 968)
* ensure-connection-open <1>: Public generic functions.
(line 983)
* ensure-connection-open <2>: Public generic functions.
(line 992)
* env: Private generic functions.
(line 1656)
* env <1>: Private generic functions.
(line 1661)
* event-type-wire-name: Private ordinary functions.
(line 1478)
* execute-script: Public generic functions.
(line 997)
* execute-script <1>: Public generic functions.
(line 1005)
* extract-datastar-from-query: Private ordinary functions.
(line 1485)
* extract-json-data: Private generic functions.
(line 1670)
* extract-json-data <1>: Private generic functions.
(line 1679)
* extract-json-data <2>: Private generic functions.
(line 1683)
* extract-json-data <3>: Private generic functions.
(line 1686)
* extract-json-data <4>: Private generic functions.
(line 1690)
* extract-json-data <5>: Private generic functions.
(line 1696)
* extract-json-data <6>: Private generic functions.
(line 1700)
* extract-json-data <7>: Private generic functions.
(line 1704)
* extract-json-data <8>: Private generic functions.
(line 1708)
* extract-json-data <9>: Private generic functions.
(line 1712)
* extract-json-data <10>: Private generic functions.
(line 1717)
* finish-output-before-flush: Private generic functions.
(line 1722)
* finish-output-before-flush <1>: Private generic functions.
(line 1734)
* finish-output-before-flush <2>: Private generic functions.
(line 1742)
* flush-sse-streams: Private ordinary functions.
(line 1492)
* Function, %js-object: Private ordinary functions.
(line 1416)
* Function, %js-value: Private ordinary functions.
(line 1422)
* Function, %kebab->camel: Private ordinary functions.
(line 1428)
* Function, %plist-to-nested-hash-table: Private ordinary functions.
(line 1435)
* Function, %set-signal-in: Private ordinary functions.
(line 1445)
* Function, %sse-action: Private ordinary functions.
(line 1452)
* Function, build-script-tag: Private ordinary functions.
(line 1457)
* Function, console-error: Public ordinary functions.
(line 744)
* Function, console-log: Public ordinary functions.
(line 754)
* Function, datastar-url: Public ordinary functions.
(line 763)
* Function, detect-clack-backend-type: Private ordinary functions.
(line 1466)
* Function, ds-expr: Public ordinary functions.
(line 771)
* Function, event-type-wire-name: Private ordinary functions.
(line 1479)
* Function, extract-datastar-from-query: Private ordinary functions.
(line 1486)
* Function, flush-sse-streams: Private ordinary functions.
(line 1493)
* Function, generator-construction-form: Private ordinary functions.
(line 1502)
* Function, get-clack-header: Private ordinary functions.
(line 1509)
* Function, init-signals: Public ordinary functions.
(line 778)
* Function, make-buffering-writer-stream: Private ordinary functions.
(line 1518)
* Function, make-clack-sse-generator: Public ordinary functions.
(line 788)
* Function, make-compression-stream: Private ordinary functions.
(line 1524)
* Function, make-hunchentoot-sse-generator: Public ordinary functions.
(line 805)
* Function, make-sse-generator: Public ordinary functions.
(line 820)
* Function, maybe-send-keepalive: Private ordinary functions.
(line 1536)
* Function, namespace-p: Private ordinary functions.
(line 1543)
* Function, parse-and-validate-json: Private ordinary functions.
(line 1549)
* Function, patch-mode-p: Private ordinary functions.
(line 1558)
* Function, prefix-data-lines: Private ordinary functions.
(line 1564)
* Function, read-signal: Public ordinary functions.
(line 835)
* Function, redirect: Public ordinary functions.
(line 852)
* Function, remove-element: Public ordinary functions.
(line 862)
* Function, select-compression-algorithm: Private ordinary functions.
(line 1572)
* Function, sleep-body-interval: Private ordinary functions.
(line 1587)
* Function, sse-delete: Public ordinary functions.
(line 870)
* Function, sse-get: Public ordinary functions.
(line 877)
* Function, sse-patch: Public ordinary functions.
(line 886)
* Function, sse-post: Public ordinary functions.
(line 893)
* Function, sse-put: Public ordinary functions.
(line 902)
* Function, woo-extension-loaded-p: Private ordinary functions.
(line 1593)
* generator-construction-form: Private ordinary functions.
(line 1501)
* Generic Function, (setf buffer): Private generic functions.
(line 1617)
* Generic Function, (setf callback): Private generic functions.
(line 1629)
* Generic Function, (setf compressed-stream): Private generic functions.
(line 1643)
* Generic Function, (setf datastar-error-message): Public generic functions.
(line 942)
* Generic Function, (setf env): Private generic functions.
(line 1658)
* Generic Function, (setf invalid-json-error-json-string): Public generic functions.
(line 1014)
* Generic Function, (setf raw-stream): Private generic functions.
(line 1758)
* Generic Function, (setf request): Private generic functions.
(line 1772)
* Generic Function, (setf responder): Private generic functions.
(line 1786)
* Generic Function, (setf response): Private generic functions.
(line 1800)
* Generic Function, (setf sse-connection-lost-generator): Public generic functions.
(line 1201)
* Generic Function, (setf woo-generator-evloop): Private generic functions.
(line 1814)
* Generic Function, buffer: Private generic functions.
(line 1606)
* Generic Function, callback: Private generic functions.
(line 1628)
* Generic Function, close-sse-generator: Public generic functions.
(line 913)
* Generic Function, compressed-stream: Private generic functions.
(line 1642)
* Generic Function, datastar-error-message: Public generic functions.
(line 941)
* Generic Function, datastar-request-p: Public generic functions.
(line 954)
* Generic Function, ensure-connection-open: Public generic functions.
(line 969)
* Generic Function, env: Private generic functions.
(line 1657)
* Generic Function, execute-script: Public generic functions.
(line 999)
* Generic Function, extract-json-data: Private generic functions.
(line 1671)
* Generic Function, finish-output-before-flush: Private generic functions.
(line 1723)
* Generic Function, invalid-json-error-json-string: Public generic functions.
(line 1013)
* Generic Function, keep-sse-alive: Public generic functions.
(line 1026)
* Generic Function, lock: Private generic functions.
(line 1747)
* Generic Function, notify-connection: Public generic functions.
(line 1042)
* Generic Function, patch-elements: Public generic functions.
(line 1072)
* Generic Function, patch-signals: Public generic functions.
(line 1089)
* Generic Function, raw-stream: Private generic functions.
(line 1757)
* Generic Function, read-signals: Public generic functions.
(line 1113)
* Generic Function, request: Private generic functions.
(line 1771)
* Generic Function, responder: Private generic functions.
(line 1785)
* Generic Function, response: Private generic functions.
(line 1799)
* Generic Function, run-sse-loop: Public generic functions.
(line 1154)
* Generic Function, send-event: Public generic functions.
(line 1182)
* Generic Function, sse-connection-lost-generator: Public generic functions.
(line 1200)
* Generic Function, woo-generator-evloop: Private generic functions.
(line 1813)
* get-clack-header: Private ordinary functions.
(line 1508)
* ignore-teardown-errors: Private macros. (line 1401)
* init-signals: Public ordinary functions.
(line 777)
* initialize-instance: Public standalone methods.
(line 1219)
* initialize-instance <1>: Public standalone methods.
(line 1227)
* initialize-instance <2>: Public standalone methods.
(line 1242)
* invalid-json-error-json-string: Public generic functions.
(line 1012)
* invalid-json-error-json-string <1>: Public generic functions.
(line 1017)
* keep-sse-alive: Public generic functions.
(line 1025)
* keep-sse-alive <1>: Public generic functions.
(line 1032)
* keep-sse-alive <2>: Public generic functions.
(line 1037)
* lock: Private generic functions.
(line 1746)
* lock <1>: Private generic functions.
(line 1750)
* Macro, ignore-teardown-errors: Private macros. (line 1402)
* Macro, with-sse-connection: Public macros. (line 652)
* Macro, with-sse-lock: Public macros. (line 694)
* Macro, with-sse-response: Public macros. (line 704)
* make-buffering-writer-stream: Private ordinary functions.
(line 1517)
* make-clack-sse-generator: Public ordinary functions.
(line 786)
* make-compression-stream: Private ordinary functions.
(line 1523)
* make-hunchentoot-sse-generator: Public ordinary functions.
(line 803)
* make-sse-generator: Public ordinary functions.
(line 817)
* maybe-send-keepalive: Private ordinary functions.
(line 1534)
* Method, (setf buffer): Private generic functions.
(line 1622)
* Method, (setf callback): Private generic functions.
(line 1636)
* Method, (setf compressed-stream): Private generic functions.
(line 1650)
* Method, (setf datastar-error-message): Public generic functions.
(line 949)
* Method, (setf env): Private generic functions.
(line 1665)
* Method, (setf invalid-json-error-json-string): Public generic functions.
(line 1021)
* Method, (setf raw-stream): Private generic functions.
(line 1765)
* Method, (setf request): Private generic functions.
(line 1779)
* Method, (setf responder): Private generic functions.
(line 1793)
* Method, (setf response): Private generic functions.
(line 1807)
* Method, (setf sse-connection-lost-generator): Public generic functions.
(line 1208)
* Method, (setf woo-generator-evloop): Private generic functions.
(line 1821)
* Method, buffer: Private generic functions.
(line 1611)
* Method, callback: Private generic functions.
(line 1634)
* Method, close: Public standalone methods.
(line 1217)
* Method, close-sse-generator: Public generic functions.
(line 921)
* Method, close-sse-generator <1>: Public generic functions.
(line 929)
* Method, compressed-stream: Private generic functions.
(line 1648)
* Method, datastar-error-message: Public generic functions.
(line 947)
* Method, datastar-request-p: Public generic functions.
(line 963)
* Method, datastar-request-p <1>: Public generic functions.
(line 966)
* Method, ensure-connection-open: Public generic functions.
(line 985)
* Method, ensure-connection-open <1>: Public generic functions.
(line 994)
* Method, env: Private generic functions.
(line 1663)
* Method, execute-script: Public generic functions.
(line 1008)
* Method, extract-json-data: Private generic functions.
(line 1681)
* Method, extract-json-data <1>: Private generic functions.
(line 1684)
* Method, extract-json-data <2>: Private generic functions.
(line 1688)
* Method, extract-json-data <3>: Private generic functions.
(line 1692)
* Method, extract-json-data <4>: Private generic functions.
(line 1697)
* Method, extract-json-data <5>: Private generic functions.
(line 1702)
* Method, extract-json-data <6>: Private generic functions.
(line 1706)
* Method, extract-json-data <7>: Private generic functions.
(line 1710)
* Method, extract-json-data <8>: Private generic functions.
(line 1714)
* Method, extract-json-data <9>: Private generic functions.
(line 1719)
* Method, finish-output-before-flush: Private generic functions.
(line 1736)
* Method, finish-output-before-flush <1>: Private generic functions.
(line 1744)
* Method, initialize-instance: Public standalone methods.
(line 1221)
* Method, initialize-instance <1>: Public standalone methods.
(line 1231)
* Method, initialize-instance <2>: Public standalone methods.
(line 1245)
* Method, invalid-json-error-json-string: Public generic functions.
(line 1019)
* Method, keep-sse-alive: Public generic functions.
(line 1034)
* Method, keep-sse-alive <1>: Public generic functions.
(line 1038)
* Method, lock: Private generic functions.
(line 1751)
* Method, notify-connection: Public generic functions.
(line 1067)
* Method, patch-elements: Public generic functions.
(line 1081)
* Method, patch-signals: Public generic functions.
(line 1098)
* Method, patch-signals <1>: Public generic functions.
(line 1103)
* Method, patch-signals <2>: Public generic functions.
(line 1108)
* Method, raw-stream: Private generic functions.
(line 1763)
* Method, read-signals: Public generic functions.
(line 1135)
* Method, read-signals <1>: Public generic functions.
(line 1140)
* Method, read-signals <2>: Public generic functions.
(line 1147)
* Method, request: Private generic functions.
(line 1777)
* Method, responder: Private generic functions.
(line 1791)
* Method, response: Private generic functions.
(line 1805)
* Method, run-sse-loop: Public generic functions.
(line 1173)
* Method, send-event: Public generic functions.
(line 1190)
* Method, send-event <1>: Public generic functions.
(line 1198)
* Method, sse-connection-lost-generator: Public generic functions.
(line 1206)
* Method, stream-finish-output: Public standalone methods.
(line 1251)
* Method, stream-force-output: Public standalone methods.
(line 1257)
* Method, stream-write-byte: Public standalone methods.
(line 1263)
* Method, stream-write-sequence: Public standalone methods.
(line 1269)
* Method, woo-generator-evloop: Private generic functions.
(line 1819)
* namespace-p: Private ordinary functions.
(line 1542)
* notify-connection: Public generic functions.
(line 1041)
* notify-connection <1>: Public generic functions.
(line 1065)
* parse-and-validate-json: Private ordinary functions.
(line 1548)
* patch-elements: Public generic functions.
(line 1070)
* patch-elements <1>: Public generic functions.
(line 1078)
* patch-mode-p: Private ordinary functions.
(line 1557)
* patch-signals: Public generic functions.
(line 1087)
* patch-signals <1>: Public generic functions.
(line 1095)
* patch-signals <2>: Public generic functions.
(line 1100)
* patch-signals <3>: Public generic functions.
(line 1105)
* prefix-data-lines: Private ordinary functions.
(line 1563)
* raw-stream: Private generic functions.
(line 1756)
* raw-stream <1>: Private generic functions.
(line 1761)
* read-signal: Public ordinary functions.
(line 834)
* read-signals: Public generic functions.
(line 1112)
* read-signals <1>: Public generic functions.
(line 1134)
* read-signals <2>: Public generic functions.
(line 1139)
* read-signals <3>: Public generic functions.
(line 1145)
* redirect: Public ordinary functions.
(line 851)
* remove-element: Public ordinary functions.
(line 860)
* request: Private generic functions.
(line 1770)
* request <1>: Private generic functions.
(line 1775)
* responder: Private generic functions.
(line 1784)
* responder <1>: Private generic functions.
(line 1789)
* response: Private generic functions.
(line 1798)
* response <1>: Private generic functions.
(line 1803)
* run-sse-loop: Public generic functions.
(line 1151)
* run-sse-loop <1>: Public generic functions.
(line 1170)
* select-compression-algorithm: Private ordinary functions.
(line 1570)
* send-event: Public generic functions.
(line 1180)
* send-event <1>: Public generic functions.
(line 1188)
* send-event <2>: Public generic functions.
(line 1195)
* sleep-body-interval: Private ordinary functions.
(line 1586)
* sse-connection-lost-generator: Public generic functions.
(line 1199)
* sse-connection-lost-generator <1>: Public generic functions.
(line 1204)
* sse-delete: Public ordinary functions.
(line 869)
* sse-get: Public ordinary functions.
(line 876)
* sse-patch: Public ordinary functions.
(line 885)
* sse-post: Public ordinary functions.
(line 892)
* sse-put: Public ordinary functions.
(line 901)
* stream-finish-output: Public standalone methods.
(line 1249)
* stream-force-output: Public standalone methods.
(line 1256)
* stream-write-byte: Public standalone methods.
(line 1261)
* stream-write-sequence: Public standalone methods.
(line 1267)
* with-sse-connection: Public macros. (line 649)
* with-sse-lock: Public macros. (line 693)
* with-sse-response: Public macros. (line 702)
* woo-extension-loaded-p: Private ordinary functions.
(line 1592)
* woo-generator-evloop: Private generic functions.
(line 1812)
* woo-generator-evloop <1>: Private generic functions.
(line 1817)
A.3 Variables
=============
* Menu:
* *catch-errors-p*: Public special variables.
(line 552)
* *datastar-cdn-base*: Public special variables.
(line 570)
* *datastar-source*: Public special variables.
(line 577)
* *datastar-version*: Public special variables.
(line 585)
* *default-auto-remove*: Public special variables.
(line 591)
* *default-compression-level*: Public special variables.
(line 597)
* *default-compression-priority*: Public special variables.
(line 603)
* *default-keep-alive-interval*: Public special variables.
(line 612)
* *default-namespace*: Public special variables.
(line 618)
* *default-patch-mode*: Public special variables.
(line 625)
* *default-retry-duration*: Public special variables.
(line 631)
* *woo-extension-warned-p*: Private special variables.
(line 1389)
* *woo-sse-debug*: Public special variables.
(line 637)
* +event-types+: Private constants. (line 1379)
* buffer: Private classes. (line 1855)
* callback: Private classes. (line 1865)
* compressed-stream: Private classes. (line 1970)
* Constant, +event-types+: Private constants. (line 1380)
* env: Private classes. (line 1891)
* evloop: Private classes. (line 2015)
* generator: Public conditions. (line 1356)
* json-string: Public conditions. (line 1325)
* lock: Private classes. (line 1991)
* message: Public conditions. (line 1303)
* raw-stream: Private classes. (line 1981)
* request: Private classes. (line 1952)
* responder: Private classes. (line 1899)
* response: Private classes. (line 1960)
* Slot, buffer: Private classes. (line 1856)
* Slot, callback: Private classes. (line 1866)
* Slot, compressed-stream: Private classes. (line 1971)
* Slot, env: Private classes. (line 1892)
* Slot, evloop: Private classes. (line 2016)
* Slot, generator: Public conditions. (line 1357)
* Slot, json-string: Public conditions. (line 1326)
* Slot, lock: Private classes. (line 1992)
* Slot, message: Public conditions. (line 1304)
* Slot, raw-stream: Private classes. (line 1982)
* Slot, request: Private classes. (line 1953)
* Slot, responder: Private classes. (line 1900)
* Slot, response: Private classes. (line 1961)
* Special Variable, *catch-errors-p*: Public special variables.
(line 553)
* Special Variable, *datastar-cdn-base*: Public special variables.
(line 571)
* Special Variable, *datastar-source*: Public special variables.
(line 578)
* Special Variable, *datastar-version*: Public special variables.
(line 586)
* Special Variable, *default-auto-remove*: Public special variables.
(line 592)
* Special Variable, *default-compression-level*: Public special variables.
(line 598)
* Special Variable, *default-compression-priority*: Public special variables.
(line 604)
* Special Variable, *default-keep-alive-interval*: Public special variables.
(line 613)
* Special Variable, *default-namespace*: Public special variables.
(line 619)
* Special Variable, *default-patch-mode*: Public special variables.
(line 626)
* Special Variable, *default-retry-duration*: Public special variables.
(line 632)
* Special Variable, *woo-extension-warned-p*: Private special variables.
(line 1390)
* Special Variable, *woo-sse-debug*: Public special variables.
(line 638)
A.4 Data types
==============
* Menu:
* actions.lisp: The datastar-cl/core/actions․lisp file.
(line 343)
* attributes: Private types. (line 2028)
* buffering-writer-stream: Private classes. (line 1833)
* clack-sse-generator: Private classes. (line 1873)
* clack.lisp: The datastar-cl/clack/clack․lisp file.
(line 369)
* Class, buffering-writer-stream: Private classes. (line 1834)
* Class, clack-sse-generator: Private classes. (line 1874)
* Class, hunchentoot-sse-generator: Private classes. (line 1908)
* Class, sse-generator: Private classes. (line 1919)
* Class, woo-sse-generator: Private classes. (line 2000)
* compression-error: Public conditions. (line 1277)
* compression.lisp: The datastar-cl/core/compression․lisp file.
(line 253)
* Condition, compression-error: Public conditions. (line 1278)
* Condition, datastar-error: Public conditions. (line 1287)
* Condition, invalid-json-error: Public conditions. (line 1314)
* Condition, signal-error: Public conditions. (line 1334)
* Condition, sse-connection-lost: Public conditions. (line 1344)
* Condition, woo-error: Public conditions. (line 1365)
* conditions.lisp: The datastar-cl/core/conditions․lisp file.
(line 208)
* config.lisp: The datastar-cl/core/config․lisp file.
(line 231)
* data-lines: Private types. (line 2033)
* datastar-cl: The datastar-cl system.
(line 55)
* datastar-cl <1>: The datastar-cl package.
(line 420)
* datastar-cl.asd: The datastar-cl/datastar-cl․asd file.
(line 164)
* datastar-cl.lisp: The datastar-cl/core/datastar-cl․lisp file.
(line 283)
* datastar-cl/clack: The datastar-cl/clack system.
(line 132)
* datastar-cl/core: The datastar-cl/core system.
(line 98)
* datastar-cl/hunchentoot: The datastar-cl/hunchentoot system.
(line 76)
* datastar-error: Public conditions. (line 1286)
* event-id: Private types. (line 2039)
* event-type: Private types. (line 2044)
* File, actions.lisp: The datastar-cl/core/actions․lisp file.
(line 343)
* File, clack.lisp: The datastar-cl/clack/clack․lisp file.
(line 369)
* File, compression.lisp: The datastar-cl/core/compression․lisp file.
(line 253)
* File, conditions.lisp: The datastar-cl/core/conditions․lisp file.
(line 208)
* File, config.lisp: The datastar-cl/core/config․lisp file.
(line 231)
* File, datastar-cl.asd: The datastar-cl/datastar-cl․asd file.
(line 164)
* File, datastar-cl.lisp: The datastar-cl/core/datastar-cl․lisp file.
(line 283)
* File, hunchentoot.lisp: The datastar-cl/hunchentoot/hunchentoot․lisp file.
(line 177)
* File, package.lisp: The datastar-cl/core/package․lisp file.
(line 198)
* File, signals.lisp: The datastar-cl/core/signals․lisp file.
(line 266)
* hunchentoot-sse-generator: Private classes. (line 1907)
* hunchentoot.lisp: The datastar-cl/hunchentoot/hunchentoot․lisp file.
(line 177)
* invalid-json-error: Public conditions. (line 1313)
* namespace: Private types. (line 2049)
* Package, datastar-cl: The datastar-cl package.
(line 420)
* package.lisp: The datastar-cl/core/package․lisp file.
(line 198)
* patch-mode: Private types. (line 2054)
* retry-duration: Private types. (line 2059)
* signal-error: Public conditions. (line 1333)
* signals.lisp: The datastar-cl/core/signals․lisp file.
(line 266)
* sse-connection-lost: Public conditions. (line 1343)
* sse-generator: Private classes. (line 1918)
* System, datastar-cl: The datastar-cl system.
(line 55)
* System, datastar-cl/clack: The datastar-cl/clack system.
(line 132)
* System, datastar-cl/core: The datastar-cl/core system.
(line 98)
* System, datastar-cl/hunchentoot: The datastar-cl/hunchentoot system.
(line 76)
* Type, attributes: Private types. (line 2029)
* Type, data-lines: Private types. (line 2034)
* Type, event-id: Private types. (line 2040)
* Type, event-type: Private types. (line 2045)
* Type, namespace: Private types. (line 2050)
* Type, patch-mode: Private types. (line 2055)
* Type, retry-duration: Private types. (line 2060)
* woo-error: Public conditions. (line 1364)
* woo-sse-generator: Private classes. (line 1999)
(defroute datastar-cl-docs (:get :text/html))