Work stealing thread pool for CPU-bound tasks. Use for compute-intensive work that should not block. Pool size scales with available CPUs.
Work stealing thread pool for CPU-bound tasks. Use for compute-intensive work that should not block. Pool size scales with available CPUs.
(delegate-cpu f)Queue work for execution on the CPU thread pool (CLJ only).
Use for compute-intensive operations that should not block. Throws in ClojureScript - use delegate-virtual instead.
Returns a Future (CLJ) for cancellation.
Queue work for execution on the CPU thread pool (CLJ only). Use for compute-intensive operations that should not block. Throws in ClojureScript - use delegate-virtual instead. Returns a Future (CLJ) for cancellation.
(delegate-scheduled ms-or-duration f)Schedule work for delayed execution.
Use for sleep, timeout, and other time-based operations.
Args: ms-or-duration - Delay as milliseconds (non-negative Long) or java.time.Duration f - Function to execute after delay
Returns a ScheduledFuture for cancellation.
Schedule work for delayed execution. Use for sleep, timeout, and other time-based operations. Args: ms-or-duration - Delay as milliseconds (non-negative Long) or java.time.Duration f - Function to execute after delay Returns a ScheduledFuture for cancellation.
(delegate-scheduled ms f)Schedule work for delayed execution.
Use for sleep, timeout, and other time-based operations.
Args: ms - Delay in milliseconds (non-negative integer) f - Function to execute after delay
Returns a function that cancels the timeout via clearTimeout.
Schedule work for delayed execution. Use for sleep, timeout, and other time-based operations. Args: ms - Delay in milliseconds (non-negative integer) f - Function to execute after delay Returns a function that cancels the timeout via clearTimeout.
(delegate-sync f)Execute work synchronously on the current thread.
Use for lightweight operations that complete immediately, such as grounding already-resolved values or synchronous transforms.
Returns nil (no cancellation handle - work completes before returning).
Execute work synchronously on the current thread. Use for lightweight operations that complete immediately, such as grounding already-resolved values or synchronous transforms. Returns nil (no cancellation handle - work completes before returning).
(delegate-virtual f)Queue work for async execution on virtual threads (CLJ) or microtask queue (CLJS).
Use for IO-bound operations: network calls, file IO, and other blocking work. This is the default delegator for tasks.
Returns a cancellation handle:
Queue work for async execution on virtual threads (CLJ) or microtask queue (CLJS). Use for IO-bound operations: network calls, file IO, and other blocking work. This is the default delegator for tasks. Returns a cancellation handle: - CLJ: Future (cancel via Future/.cancel) - CLJS: Function that aborts the task's AbortController
Single-thread executor for scheduling delayed tasks (sleep, timeout).
Single-thread executor for scheduling delayed tasks (sleep, timeout).
Virtual thread executor for IO-bound tasks. Creates a new virtual thread per task. Default executor for tasks - use for network calls, file IO, and blocking operations.
Virtual thread executor for IO-bound tasks. Creates a new virtual thread per task. Default executor for tasks - use for network calls, file IO, and blocking operations.
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 |