(get-thread-scope)Captures the current scope (if any). Returns a map of Var => bound-value.
Captures the current scope (if any). Returns a map of Var => bound-value.
(scoped-fn & fntail)Like clojure.core/bound-fn, but for ScopedValue (instead of ThreadLocal).
Like `clojure.core/bound-fn`, but for ScopedValue (instead of ThreadLocal).
(scoped-fn* f)Like clojure.core/bound-fn*, but for ScopedValue (instead of ThreadLocal).
Like `clojure.core/bound-fn*`, but for ScopedValue (instead of ThreadLocal).
(scoped-future & body)Like clojure.core/future, but also conveys the current thread scope.
Like `clojure.core/future`, but also conveys the current thread scope.
(scoped-future-call f)Like clojure.core/future-call, but also conveys the current thread scope.
Like `clojure.core/future-call`, but also conveys the current thread scope.
(scoping bindings & body)Like clojure.core/binding, but forScopedValue, rather thanThreadLocal`.
Like `clojure.core/binding, but for `ScopedValue`, rather than `ThreadLocal`.
(with-scope scope & body)Executes <body> within the context of the
provided <scope> - e.g. captured by current-scope.
Useful for passing down scope to child threads.
The pattern is as follows:
(scoping [...] ;; set up initial bindings
(let [parent (current-scope)] ;; fetch current scope in this thread
(future
(with-scope parent ;; restore parent's scope in child thread
(current-scope))))) ;; inspect current-scope in child thread (equals parent)
Executes <body> within the context of the
provided <scope> - e.g. captured by `current-scope`.
Useful for passing down scope to child threads.
The pattern is as follows:
(scoping [...] ;; set up initial bindings
(let [parent (current-scope)] ;; fetch current scope in this thread
(future
(with-scope parent ;; restore parent's scope in child thread
(current-scope))))) ;; inspect current-scope in child thread (equals parent)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 |