I had the brilliant idea of using CouchDB for something equally brilliant, and if possible implement a Clojure view server. Turns out Clutch fits the bill perfectly, except that I would like to use Aleph, and Couch is using something called MVCC.
I haven't looked into the libs to deep, but I know the REST API, and what it does for updating is that you need to supply the current revision and if it doesn't match (i.e. there has been another update), the update fails. So then you need to get the new _rev and try again. Much the same way compare-and-set! works.
I thought it would be perfect to implement IAtom and IDeref to get the latest value and to swap! documents in a spin loop with a side-effect-free function, like atoms do.
But it turns out there is no interface for Atom and it is marked final. The same is true for Ref and Agent, but raek suggested this might be because they are more complex and integrated with the STM.
Is there a good reason why I'm not allowed to implement my own atom? If not, can it be added? Thanks.
Groeten,
Pepijn de Vos
--
Sent from my iPod Shuffle
http://pepijndevos.nl