Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Riak loader for CRDTs

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 riak_crdt
Octocat-spinner-32 tests
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 setup.cfg
Octocat-spinner-32 setup.py
README.md

Introduction

riak_crdt is a CRDT loader for Riak using the crdt API

Usage

from riak_crdt.loader import Loader
from crdt.sets import LWWSet
from riak import RiakClient

client = RiakClient()
bucket = client.bucket("friends")

with Loader(LWWSet, bucket," "eric") as (loader, friend_set):
    friend_set.add("tom")

What just happened?

  1. The loader fetched the riak object at friends/eric
  2. If the object did not exist, a new LWWSet is created
  3. If the object did exist but had siblings, the LWWSet.merge method resolves the conflict.
  4. Otherwise, a LWWSet is used using the riak object's payload
  5. After the with block concludes, the Loader stores the object

Refer to the crdt README for more details.

Something went wrong with that request. Please try again.