Liking cljdoc? Tell your friends :D
Clojure only.

loom-otp.vfuture

Virtual thread future - like clojure.core/future but always uses virtual threads.

Usage: (let [f (vfuture (expensive-computation))] ;; do other work @f) ; blocks until computation completes

Exceptions thrown in the body are re-thrown when dereferencing. Dynamic bindings from the calling thread are preserved.

Virtual thread future - like clojure.core/future but always uses virtual threads.

Usage:
(let [f (vfuture (expensive-computation))]
  ;; do other work
  @f)  ; blocks until computation completes

Exceptions thrown in the body are re-thrown when dereferencing.
Dynamic bindings from the calling thread are preserved.
raw docstring

vfuturecljmacro

(vfuture & body)

Execute body on a virtual thread. Returns a derefable future.

Dereferencing blocks until the computation completes and returns the result. If the body throws an exception, it is re-thrown when dereferencing.

Dynamic bindings from the calling thread are preserved. Supports timeout via (deref f timeout-ms timeout-val).

Execute body on a virtual thread. Returns a derefable future.

Dereferencing blocks until the computation completes and returns the result.
If the body throws an exception, it is re-thrown when dereferencing.

Dynamic bindings from the calling thread are preserved.
Supports timeout via (deref f timeout-ms timeout-val).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close