Last active
July 14, 2017 17:28
-
-
Save whilo/4f4e8a9e4095001cf5c1c43ed5c1b2b4 to your computer and use it in GitHub Desktop.
Antidote Clojure Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clj-antidote.core | |
(:import [eu.antidotedb.client AntidoteClient Host | |
BatchRead BatchReadResult Bucket CounterRef | |
InteractiveTransaction SetRef])) | |
(def client (AntidoteClient. [(Host. "localhost" 8087)])) | |
(def bucket (Bucket/create "testbucket")) | |
(def counter-ref (.counter bucket "mycounter")) | |
(defn no-trans [] (.noTransaction client)) | |
(.increment counter-ref (no-trans)) | |
(.read counter-ref (no-trans)) | |
(def set-ref (.set bucket "myset")) | |
(.add set-ref (no-trans) "hahaha") | |
(.read set-ref (no-trans)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment