Safe Haskell | None |
---|---|
Language | Haskell2010 |
CRDT operations
Haskell-side
Riak-side
get
to get a current valuesendModify
to ask Riak to apply modifications
TL;DR example
>>>
let c = Counter 41
>>>
let op = CounterInc 1
>>>
modify op c
Counter 42>>>
get conn "counters" "bucket" "key"
Just (DTCounter (Counter 41))>>>
sendModify conn "counters" "bucket" "key" [op] >> get conn "counters" "bucket" "key"
Just (DTCounter (Counter 42))
Synopsis
- module Network.Riak.CRDT.Types
- get :: Connection -> BucketType -> Bucket -> Key -> IO (Maybe DataType)
- class MapCRDT a => CRDT a op | a -> op, op -> a where
- modify :: op -> a -> a
- sendModify :: Connection -> BucketType -> Bucket -> Key -> [op] -> IO ()
Documentation
module Network.Riak.CRDT.Types
get :: Connection -> BucketType -> Bucket -> Key -> IO (Maybe DataType) Source #
class MapCRDT a => CRDT a op | a -> op, op -> a where Source #
CRDT types
modify :: op -> a -> a Source #
Modify a value by applying an operation
sendModify :: Connection -> BucketType -> Bucket -> Key -> [op] -> IO () Source #
Request riak a modification
Instances
CRDT Counter CounterOp Source # | |
Defined in Network.Riak.CRDT modify :: CounterOp -> Counter -> Counter Source # sendModify :: Connection -> BucketType -> Bucket -> Key -> [CounterOp] -> IO () Source # | |
CRDT Set SetOp Source # | |
Defined in Network.Riak.CRDT modify :: SetOp -> Set -> Set Source # sendModify :: Connection -> BucketType -> Bucket -> Key -> [SetOp] -> IO () Source # | |
CRDT Map MapOp Source # | |
Defined in Network.Riak.CRDT modify :: MapOp -> Map -> Map Source # sendModify :: Connection -> BucketType -> Bucket -> Key -> [MapOp] -> IO () Source # |