I was reading Clojure in Action and thinking about agents. It seems that by hooking up agents with watches, update functions, and some simple locks, you could create a “reactive" state management. So that when some value a
is updated then all dependent state values update themselves automatically and in parallel on separate threads. While those values are updating you are free to change other state values that aren't in the same dependency graph
I wrote up a quick draft but then started to look around online (it felt like a bit too obvious of an extension to the agent model). I found some similar ideas back in ~2009 but the trail goes dry. Is there some reason this isn't used more widely? Or is this some modern library I'm missing?
There was a "cell" implementation by Stuart Sierra called auto-agents
- though I can't find the code
https://groups.google.com/g/clojure/c/NY834N34QvA
I also found this complete implementation but it's also got no traction at all
https://github.com/apatil/lazy-agent
Has this crystallized into a library somewhere? I'm thinking of writing my own implementation but I wanted a sanity check. I'm concerned maybe this idea was dropped for some reasons I've not considered
(I'm aware there are things like Javelin, Odoyle and Missionary that can accomplish similar things.. but while they decouple code, they're way too complicated and some don't have a threading story)
This is a copy of my question on Reddit:
https://reddit.com/comments/1hklfyh/comment/m3gyyoq