Commit Graph

6 Commits

Author SHA1 Message Date
rigelrozanski d28efaac27 many renames / golint compliance 2018-04-19 00:49:24 -04:00
Sunny Aggarwal f10983ba06 address review 2018-04-05 21:54:30 +02:00
Sunny Aggarwal c441ccdf01 added more test 2018-04-01 18:00:28 +02:00
Jae Kwon be665d53fe Substore->Store; BaseApp has db; Mapper 2018-01-22 06:20:46 -08:00
Jae Kwon 6f9a08d921 Conform to new tmlibs Iterator 2017-12-21 03:44:04 -08:00
Jae Kwon eb1f877d3d
KVStore refactor (#303)
I removed that stuff about cwwMutex and CacheWraps expiring. It was unnecessary complexity given that users need not write concurrent logic. If you have 2 CacheKVStores and you Write on one and later you Write on the other one, they will both write, and strange things may happen. But that’s OK, it’s kinda the expected (unsurprising) behavior. And now the code is much simpler.

Also I got rid of IterKVStore. It’s not necessary to distinguish them because we can have KVStore.Iterator() return nil or panic or an empty iterator. Further simplification…

KVStore.CacheKVStore() doesn’t exist. No need, just call NewCacheKVStore(parent).

Originally I wanted the .CacheKVStore() method because you can make the implementor be responsible for ensuring that returned CacheWraps don’t trample each other. But as written previously this complicates the code a lot more and it isn’t strictly necessary. It’s a kind of magic that maybe should just be avoided.

sdk.Iterator is dbm.Iterator. The plan is to conservatively add more aliases into the “sdk” namespace.

GetError() is removed from Iterator. We need to just panic to be consistent. More simplification.
2017-12-12 20:13:51 -08:00