eliassona/redisatom


Implements clojure atom interface with clojure as durable storage

License: EPL-1.0

Language: Clojure


redisatom

A Clojure library that implements redis as a durable atom.

Usage

Clojure

Add the following line to your leinigen dependencies:

[redisatom "0.1.0-SNAPSHOT"]
=> (use 'redisatom.core)
=> (import 'redis.clients.jedis.Jedis)
=> (def ra (redis-atom (Jedis.)))
=> (def atom-for-a-key (ra "key"))
=> (def a (ra "key"))
=> @a
nil
=> (reset! a 0)
0
=> (swap! a inc)
1

There is also a function for iterating the keys with a lazy-seq.

=> (def j (Jedis.)) 
=> (def ra (redis-atom j))
=> (dotimes [i 10] (reset! (ra (str i)) "some value")) ;insert some values into redis
=> (redis-keys j)
("0" "6" "3" "9" "1" "4" "8" "7" "5" "2")

License

Copyright © 2018 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Project Statistics

Sourcerank 3
Repository Size 10.7 KB
Stars 1
Forks 0
Watchers 1
Open issues 0
Dependencies 2
Contributors 1
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

Anders Eliasson

Packages Referencing this Repo

redisatom
Redis Atom
Latest release 0.1.0-SNAPSHOT - Published - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2018-07-18 08:46:43 UTC

Login to resync this repository