Loom.AWORMap
An add-wins observed-remove map or CRDTs, based on optimized sets.
Compose any CRDT that implements the Loom.CRDT
protocol. This is awkward by
itself because of the use of copious key-module pairs.
Summary
delete(set, key, module) | Delete an entry for a key-module pair |
get(map, key, module) | Get a value for a key-module pair |
has_key?(awormap, key, module) | Checks if a key-module pair exists in the map already for the key |
join(awormap, awormap) | Join a map |
keys(awormap) | Returns the set of all key-module pairs |
new() | Returns a new AWORMap |
put(map, actor, key, value) | Insert a value, and merge it with any that exist already |
value(awormap) | Returns a map of values for key-module pairs |
Functions
Specs:
Delete an entry for a key-module pair
Specs:
Get a value for a key-module pair
Specs:
Checks if a key-module pair exists in the map already for the key.
Specs:
Returns the set of all key-module pairs
Specs:
- new :: t
Returns a new AWORMap
The identity value of an empty AWORMap is nil
because of the difficulties
of matching against %{}
, which is not the equivalent of []
.
iex> Loom.AWORMap.new |> Loom.AWORMap.value
nil
Specs:
Insert a value, and merge it with any that exist already