Clojure: atom vs agent vs ref

2017-10-06
阅读 2 分钟
2.5k
First atom, agent and ref are work for mutable state and threads. Atom It is synchronous, and will retry when other thread change the state. Use case: memoize. Functions for agent: atom, deref, @, swap!, reset! Agent It is asynchronous. It has :error-handler, and :error-mode. when validate failed...