Skip to content

clojure.core/deref

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 3 Runnable: 0
([ref] [ref timeout-ms timeout-val])

Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns the in-transaction-value of ref, else returns the most-recently-committed value of ref. When applied to a var, agent or atom, returns its current state. When applied to a delay, forces it if not already forced. When applied to a future, will block if computation not complete. When applied to a promise, will block until a value is delivered. The variant taking a timeout can be used for blocking references (futures and promises), and will return timeout-val if the timeout (in milliseconds) is reached before a value is available. See also - realized?.

Examples

by dakrone on . May have evaluation errors.
by kgann on . May have evaluation errors.
by viebel on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.