A conversation is a value the framework manipulates on every event.
That value has to be persisted (for crash-resume), inspected
(for halos and s/inspect), and tested (replays from a vector of
events should produce the exact same value as the live path).
We could store live JVM objects on the conversation — open SSE
generators, future references, raw closures, JDBC connections,
cloroutine continuations. It would be ergonomic; a handler could
stash whatever it needed on self and read it back later.
Conversation values are EDN. (pr-str conv) round-trips through
(clojure.edn/read-string …) to an equal value, with one deliberate
exception (see Consequences).
file-store writes one EDN
file per conversation; on restart, load-all reads them back and
the kernel resumes mid-flight.core/replay walks a vector of
events against a fresh conversation; assertions are plain =
against expected values. No server, no SSE, no threading.pr-str of the live instance map. EDN-clean means
every field is readable; nothing renders as #object[…].defflow is the exception. A cloroutine continuation cannot
round-trip through EDN — the underlying class is gensym'd and
varies across REPL reloads. The framework allows it (the
ergonomics earn their keep for transient flows) but the file store
refuses to persist a conversation that contains one, with a clear
warning. Apps that need durable flows write hand-rolled task
components instead. See the tutorial section Durable flows:
defflow vs. task components.:app value, which is not persisted with the
conversation. See 0004.Can you improve this documentation?Edit on GitHub
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 |