-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MaxReg
and MinReg
registers
#146
Conversation
…r decreasing value respectively. The struct has a single field val to maintain consistent format with the rest of the library. Possibly we want to add another field that can represent a bound (upper, lower) on the size of val.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just mainly some style points to ensure the library has a uniform feel across CRDT's in the same family.
Ok! I will resolve these. Thanks @davidrusu |
…for read and write functions. Modified test_update for MinReg and MaxReg
Hi @davidrusu I just pushed the changes. Let me know if there are any other steps to take / changes to make. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few more nits
…ead of self.merge. Applies suggestions in PR rust-crdt#146
Hi @davidrusu, no problem at all. Hopefully I followed all of your suggestions correctly at this point, but happy to fix anything else you think isn't conforming to the format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent, thank you
@DaveLanday looks like the doc tests are failing, can you fix those? You can run doc tests with
Also, while your at, make sure that |
…ing semi-colons, and struct fields.
Hi @davidrusu I fixed the issues (typos, etc...) It passes |
…and write functions. Modified test_update for MinReg and MaxReg
…ead of self.merge. Applies suggestions in PR #146
Thanks! |
…or read and write functions. Modified test_update for MinReg and MaxReg" This reverts commit 9ceb1e2.
@DaveLanday heads up, you should set your email in your git config, as it stands, the commits you had made are not linked to your profile! I'm mentioning so that you get credit for your work in the future! |
Ooooo! thank you for letting me know. Is there anyway to get recognition after |
The commits are still linked to this PR so people can find you that way, but they just don't link directly to your profile the way that other commits do. There's nothing more to do now for these commits, but future commits will be linked correctly if you commit using an email that is used in your github profile |
This PR comes from the following discussion: #145 (comment).
MaxReg
andMinReg
CRDTs track a monotonically increasing or decreasing value respectively. The struct has a single field calledval
to maintain consistent format with theLWWReg
CRDT, which has fieldsval
andmarker
.MaxReg
andMinReg
do not need amarker
as they are monotonic values and can technically be considered amarker
. The single fieldval
is preferred topub struct<V: Ord Copy> MinReg(V)
as it is clear what the struct contains and will allow adding any other fields in the future. A field that might be interesting to add could bebound
which acts as an upper/lower bound on the opaque value storedval
. This could be used as a convenient termination signal or as a way to test whether distributed replicas of aMinReg
orMaxReg
have reached some agreed upon state etc...