Skip to content

Instantly share code, notes, and snippets.

@gerritjvv
Created May 7, 2015 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerritjvv/4c353066e6bd1135449a to your computer and use it in GitHub Desktop.
Save gerritjvv/4c353066e6bd1135449a to your computer and use it in GitHub Desktop.
using bounded clojure agents from fun-utils
(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