Skip to content
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

Create Register atoms #6

Open
9 tasks
brunokim opened this issue Aug 11, 2022 · 0 comments
Open
9 tasks

Create Register atoms #6

brunokim opened this issue Aug 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@brunokim
Copy link
Owner

brunokim commented Aug 11, 2022

A register is a data structure that holds a single value. Its update semantic is that the last write wins, with "last" being defined by the usual Atom ordering (first by priority, then timestamp, then site).

Data structures

type Register struct{}
type Value struct { Value any }
  • A Register atom may only accept Value or Delete atoms as children.
  • A Value atom may not have any children.
  • Their priorities are arbitrary.
  • A Register should report as its value the most recent Value child.

Currently, a Register can only be a child of the root atom. A Value cannot be a child of the root atom.

register

Open questions

  • What if we allow a value to be deleted? What should be the semantics - leaving the register empty, or restoring the previous value, if it exists?
  • Should a Register only allow "atomic" types wrapped in a Value, or should it also allow that a CRDT be stored?

Build tasks

  • Create data structure in crdt/rlist.go
  • Create associated operation in crdt/rlist_operation_test.go
  • Create manual tests in crdt/rlist_test.go
  • Run go test -fuzz FuzzList and fix any errors found

Demo tasks

  • Allow user to create a register in cmd/demo/static/js/crdt_controller.js (or: create one for them)
  • Allow user to modify register value
  • Detect register value change and POST it to the server
  • Create POST handler in cmd/demo/demo.go
  • (bonus) Allow user to delete register
@brunokim brunokim added the enhancement New feature or request label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant