Skip to content

Instantly share code, notes, and snippets.

@attribyte
Last active January 2, 2016 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save attribyte/67af37ec4b09a12d887f to your computer and use it in GitHub Desktop.
Save attribyte/67af37ec4b09a12d887f to your computer and use it in GitHub Desktop.
/* Yesterday */
case object DurablyFlushUpdates extends EmptyMessage
object DurablyFlushUpdatesMaterializer
extends EmptyMessageMaterializer {
def createMessage = DurablyFlushUpdates
}
/* Today */
case class DurablyFlushUpdates(replicaCount: Int = 2)
extends NameValueMessage {
def toNameValuePairs = List(
("replicaCount", replicaCount)
)
}
object DurablyFlushUpdatesMaterializer
extends SingleValueMaterializer[Int]("replicaCount") {
def createMessage(value: Option[Int]) = {
DurablyFlushUpdates(value.getOrElse(2))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment