Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Apparatus: Clojure Clusters
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
jclouds
krati
pallet
src/apparatus
test/apparatus
.gitignore
LICENSE
README.org
project.clj

README.org

Apparatus: Clojure Clusters

Build & Test apparatus

lein uberjar                               ;# create an uberjar
lein test                                  ;# run the unit tests

Play with it

nohup java -jar apparatus*standalone.jar & ;# background node (autostarts)
nohup java -jar apparatus*standalone.jar & ;# background node (autostarts)
lein repl                                  ;# interactive node

Start up the foreground node

(use '[apparatus config cluster])
(instance (config))

Make your cluster do work

(-> (eval-any '(+ 1 1)) (.get))

Store some data in your cluster

(-> (get-map "helloworld") (.put "mah" "bukkit"))
(-> (get-map "helloworld") (.get "mah"))

Have the remote node, that owns the data locally, do something with it

(-> (eval-on
     '(do (use 'apparatus.cluster)         ;# remote work definition
       (-> (get-map "helloworld")
           (.get "mah")
           (str " was found!")))
     "mah")                                ;# node that owns "mah" 
    (.get)
    (println))

Add apparatus lib to your project

(defproject myproject "1.2.3" :dependencies [[apparatus "1.0.0-SNAPSHOT"]])

Read more about Hazelcast

Something went wrong with that request. Please try again.