Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Counter should support decrements #10

Open
haadcode opened this issue Jul 30, 2016 · 2 comments
Open

Counter should support decrements #10

haadcode opened this issue Jul 30, 2016 · 2 comments

Comments

@haadcode
Copy link
Member

haadcode commented Jul 30, 2016

CounterStore currently supports only increase operations inc(value). It should also support decrements dec(value).

This can be done by implementing a PN-Counter in https://github.com/haadcode/crdts and adding appropriate interface to CounterStore.

PN-Counter works like this: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type#State-based_PN-counter

@haadcode
Copy link
Member Author

The CRDT needed for this was implemented recently by @shamb0t. To implement it here, one can follow the G-Counter as a template.

This would be a great task for first time contributors and would be highly valuable feature!

@haadcode
Copy link
Member Author

The code for PN-Counter is here

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

No branches or pull requests

1 participant