Closed hseeberger closed 9 years ago
I think the same thing can be done with ordinary LWWRegister by replacing the default clock with a reverse clock. LWWRegister and LWWMap takes an optional clock parameter. We could add something like this to LWWRegister companion.
val reverseClock = new Clock {
override def nextTimestamp(currentTimestamp: Long): Long =
math.min(0L - System.currentTimeMillis(), currentTimestamp - 1)
}
WDYT?
Awesome trick! Much better than adding lots of LOC.
Superseded by #80
Not sure if this code duplication approach is a good idea, but we could always introduce common supertypes for the common things later.