Im from C#, and my clojure expirience is about two weeks. I want track some object and receive notifications from it. In C# im using events. Any clojure best practices for this problem?
For example:
service-controller.clj
(def shared-state)
(defn start-watch [x]
;; add object to watch in shared state
)
(loop blah blah
;; check all objects in shared state and in some cases delete object, change object
recur )
in another file, i want to add listeners for service-controller shared state. engine.clj (add-listener service-controller/shared-state fn blah)
(service-controller/start-watch x)
I found agent and add-watch, its ok, but how i can modify vector inside agent?