-
-
Save karolinepauls/9c976d95950141bc3b7d8b179b65b1c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def ^:dynamic *some-context* nil) | |
(tap> "start") | |
(defn inspect [] | |
(tap> | |
(format "tap: thread=%s context=%s" | |
(.getId (Thread/currentThread)) | |
*some-context*))) | |
(binding [*some-context* "in the agent"] | |
(future (inspect))) | |
(.submit clojure.lang.Agent/soloExecutor inspect) | |
; "start" | |
; "tap: thread=498 context=in the agent" | |
; "tap: thread=498 context=in the agent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment