(ground this v on-complete)Resolve nested tasks in a value, replacing them with their results.
Walks v looking for values that satisfy groundable? (Tasks, CompletableFutures,
etc.). Found tasks are awaited in parallel. When all complete, they're replaced
with their dereferenced values in the original data structure.
Optimized by task count:
Callback signature:
CAS semantics is handled by on-complete.
Resolve nested tasks in a value, replacing them with their results. Walks `v` looking for values that satisfy `groundable?` (Tasks, CompletableFutures, etc.). Found tasks are awaited in parallel. When all complete, they're replaced with their dereferenced values in the original data structure. Optimized by task count: - 0 tasks: Return immediately (no coordination overhead) - 1 task: Single subscription (minimal overhead) - N tasks: AtomicInteger countdown + object-array (full coordination) Callback signature: - Success: (on-complete grounded-value nil) - Failure: (on-complete nil exceptional-task-state) CAS semantics is handled by `on-complete`.
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 |