Created
May 7, 2015 22:23
-
-
Save gerritjvv/4c353066e6bd1135449a to your computer and use it in GitHub Desktop.
using bounded clojure agents from fun-utils
This file contains hidden or 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
(require '[fun-utils.agent :as fagent] :reload) | |
(def agnt (fagent/agent {} :mailbox-len 10)) | |
;send to the agent | |
(fagent/send agnt assoc-in [:a :b] 2) | |
;deref | |
@agnt | |
;;{:a {:b 2}} | |
;close the agent and stop any resources | |
(fagent/close-agent agnt) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment