A set of functions and macros named after their clojure.core counterparts but acting using virtual threads.
A set of functions and macros named after their clojure.core counterparts but acting using virtual threads.
(deref-by-one coll)Deref all items from a collection lazily one by one.
Deref all items from a collection lazily one by one.
(fmap n f coll)(fmap n f coll & colls)Like pmap where each chunk of items is executed in
a dedicated virtual executor. The n parameter specifies
the chunk size. Each chunk gets completely finished and
the executor is closed before proceeding to the next chunk.
Return a lazy sequence of futures.
Like `pmap` where each chunk of items is executed in a dedicated virtual executor. The `n` parameter specifies the chunk size. Each chunk gets completely finished and the executor is closed before proceeding to the next chunk. Return a lazy sequence of futures.
(for bindings & body)Like for but performs all body expressions
in a virtual executor. The executor gets closed
afterwards. Return a lazy sequence of deref'ed
items.
Like `for` but performs all body expressions in a virtual executor. The executor gets closed afterwards. Return a lazy sequence of deref'ed items.
(future & body)Run a block of code in a virtual thread. Return a CompletableFuture that gets completed either successfully or exceptionally depending on how the code behaves.
Run a block of code in a virtual thread. Return a CompletableFuture that gets completed either successfully or exceptionally depending on how the code behaves.
(future-via [exe] & body)Submit a block of code to the given executor service. Return a future.
Submit a block of code to the given executor service. Return a future.
(map f coll)(map f coll & colls)Like map but each function is running in a virtual executor
producing a future. Return a lazy sequence that derefs futures
when iterating.
Like `map` but each function is running in a virtual executor producing a future. Return a lazy sequence that derefs futures when iterating.
(pmap n f coll)(pmap n f coll & colls)Like pmap but each chunk of items is run in a dedicated
virtual executor. Next chunk is only calculated after the
previous one was done. The n parameter specifies the
chunk size. Return a lazy sequence of items deref'fed one
by one. Based on fmap (see above).
Like `pmap` but each chunk of items is run in a dedicated virtual executor. Next chunk is only calculated after the previous one was done. The `n` parameter specifies the chunk size. Return a lazy sequence of items deref'fed one by one. Based on `fmap` (see above).
(process-by-one f coll)A helper function that accepts a sequence of items and applies a function lazily one by one.
A helper function that accepts a sequence of items and applies a function lazily one by one.
(pvalues & forms)Run forms in a dedicated virtual executor and close it afterwards. Return a lazy sequence of deref'ed futures (by one).
Run forms in a dedicated virtual executor and close it afterwards. Return a lazy sequence of deref'ed futures (by one).
(thread & body)Run a block of code in a virtual thread. Return a running VirtualThread instance.
Run a block of code in a virtual thread. Return a running VirtualThread instance.
(with-executor [bind] & body)Run a block of code with a new instance of a virtual task executor
bound to the bind symbol. The executor gets closed when exiting
the macro. Guarantees that all the submitted tasks are completed
before the executor is closed.
Run a block of code with a new instance of a virtual task executor bound to the `bind` symbol. The executor gets closed when exiting the macro. Guarantees that all the submitted tasks are completed before the executor is closed.
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 |