[CLJ-213] Invariants and the STM Created: 01/Dec/09 Updated: 24/Aug/10 |
|
| Status: | Open |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Backlog |
| Type: | Enhancement | ||
| Reporter: | Anonymous | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
(ticket requested here http://groups.google.com/group/clojure/browse_thread/thread/119311e89fa46806/4903ce25ff6deaa6#4903ce25ff6deaa6) The general idea is to declare invariants inside a transaction and, when at commit time an invariant doesn't hold anymore, the transaction retries. See the attached file for quick prototype. User code would looks like: (invariant (@world :key)) (commute world update-in [:key] val-transform-fn) This means the commute will occur only if (@world :key) returns the same value in-transaction and at commit point. |
| Comments |
| Comment by Assembla Importer [ 24/Aug/10 7:23 AM ] |
|
Converted from http://www.assembla.com/spaces/clojure/tickets/213 |