Worker pool implementation backed by Java virtual threads (JDK 21+) or a fixed platform thread pool.
Shutdown is coordinated via an atom. stop! blocks on each worker future
until it exits its current iteration.
Worker pool implementation backed by Java virtual threads (JDK 21+) or a fixed platform thread pool. Shutdown is coordinated via an atom. `stop!` blocks on each worker future until it exits its current iteration.
(vt-worker-pool {:keys [queue-backend task-config num-workers poll-interval-ms
backend-opt]
:or {poll-interval-ms 1000}})Constructs a WorkerPool backed by Java virtual threads (JDK 21+).
Options:
:queue-backend — a QBackend instance:task-config — task configuration map passed to make-qtask:num-workers — number of concurrent workers:poll-interval-ms — milliseconds to sleep between queue polls (default 1000):backend-opt — pass :platform-threads to force a fixed daemon
thread pool, e.g. on JDK < 21Constructs a `WorkerPool` backed by Java virtual threads (JDK 21+).
Options:
- `:queue-backend` — a `QBackend` instance
- `:task-config` — task configuration map passed to `make-qtask`
- `:num-workers` — number of concurrent workers
- `:poll-interval-ms` — milliseconds to sleep between queue polls (default 1000)
- `:backend-opt` — pass `:platform-threads` to force a fixed daemon
thread pool, e.g. on JDK < 21cljdoc 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 |