Quiescent

A Clojure/ClojureScript library for composable async tasks with automatic parallelization, structured concurrency, and
parent-child and chain cancellation.
In particular, Quiescent has been designed with these constraints in mind:
- A task cannot exceed the lifetime of its parent. Though there's an escape hatch for things that need to run to
completion.
- A task cannot cross the "border" of another task. Where a task would return another task, a plain value is
returned instead.
- If one task fails within a scope, all siblings should be torn down as quickly as possible while teardown of
statefully allocated resources should still complete without interruption.
Tasks go through 7 phases during their lifecycle: pending, running, grounding, transforming, writing, settling and
quiescent. This library is named after the last phase in the lifecycle, which is when all subtasks have settled and
the task tree has come to rest.
Table of contents
Requirements
Clojure
Quiescent builds heavily on virtual threads and other features present only in recent versions of the JDK.
- JDK 21+ (Virtual threads)
- JDK 25 recommended (Better virtual threads;
ScopedValue support)
- Clojure 1.12+
ClojureScript
- ClojureScript 1.11+
- Any modern JavaScript runtime (browser or Node.js)
Installation
;; deps.edn
co.multiply/quiescent {:mvn/version "0.11.5"}
Quiescent depends on four other libraries: Machine Latch,
Scoped, Pathling,
and Conc, which will be transitively available when using this library. Machine
Latch in turn depends on Scoped. There are no further dependencies.
Claude Code plugin
This repository ships a Claude Code plugin providing a quiescent skill, so Claude knows the library's semantics when
writing async code against it, plus a companion quiescent-cljs skill covering the ClojureScript delta. Both load only
when the conversation is actually working with Quiescent.
From Claude Code:
/plugin marketplace add multiplyco/quiescent
/plugin install quiescent@quiescent
This installs the plugin for yourself only.
To offer it to everyone working in a project, commit this to the project's .claude/settings.json instead. Both keys
are needed: enabledPlugins on its own names a marketplace that a fresh clone has never heard of. Collaborators are
prompted to install on trusting the repo, rather than having it installed for them.
{
"extraKnownMarketplaces": {
"quiescent": {
"source": { "source": "github", "repo": "multiplyco/quiescent" }
}
},
"enabledPlugins": {
"quiescent@quiescent": true
}
}
Core concepts
Tasks
A task represents an async computation. Create one that executes on a virtual thread with task:
(require '[co.multiply.quiescent :as q])
;; Quiescent strongly discourages parking on platform threads.
;; Let's turn it off for this REPL session, or we won't be able to dereference
;; the tasks that we create.
(q/throw-on-platform-park! false)
(def my-task
(q/task
(Thread/sleep 100)
"done"))
@my-task
;; => "done"
;; (blocks until complete)
task spawns a task that runs on a virtual thread, while cpu-task runs directly on a platform thread. q runs the
body synchronously on the calling thread. Other than that, they are all semantically equivalent.
Promises