Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

add method Counter #11

Closed
recoilme opened this issue May 6, 2018 · 1 comment
Closed

add method Counter #11

recoilme opened this issue May 6, 2018 · 1 comment

Comments

@recoilme
Copy link
Owner

recoilme commented May 6, 2018

return unique int, for use like counter
Counter(file,key) (uint32?,error?)

for speedup set+sync on every val%1000 == 0 - val+1000
for example on 0 value - set 1000
all increment - in memory
in case of crash os - value will be 1000 after crash
on val%1000 ==0 set 2000 and so on

may be mute error with 0 - for simplify in this case:
Set(file,Counter(file,key),value)

may be call Counter silently in Set with params Counter(file,file) in case of key is nil
so Set(file,nil,val) - will be autoincrement

@recoilme
Copy link
Owner Author

recoilme commented May 8, 2018

Looks good: https://github.com/recoilme/slowpoke/tree/counter
Test counter on crash may be?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant