Skip to content

Instantly share code, notes, and snippets.

@whilo
Last active July 14, 2017 17:28
Show Gist options
  • Save whilo/4f4e8a9e4095001cf5c1c43ed5c1b2b4 to your computer and use it in GitHub Desktop.
Save whilo/4f4e8a9e4095001cf5c1c43ed5c1b2b4 to your computer and use it in GitHub Desktop.
Antidote Clojure Playground
(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