redis-atom
redis-atom copied to clipboard
need to add some built-in resilience
trafficstars
Open question right now:
- what happens if atom tries to update and never succeeds?
- gotta add option for max number of retries before giving up entirely
- what happens if connection to redis is lost? timed out?
- need to handle those cases gracefully so user has clean api and no surprises
- what happens if something goes wrong in mid transaction? what are the options for rolling back?
- redis has no ability to roll back multi/exec transactions -- something like this is beyond the scope of this project and probably belongs in refs territory.
Behaviour will be controlled by an additional :option parameter that may be passed to the constructor. By default will be exactly like clojure atom, for better and for worse.
take a look at https://github.com/resilience4clj for inspiration
TODO:
- [ ] cas max retries
- [ ] cas timeout
- [ ] type of timeout evolution? const, linear, exponential
- [ ] swap timeout