Permalink
Browse files

Merge pull request #1 from timgluz/master

Added usage example.
  • Loading branch information...
2 parents d669412 + b3d9dc3 commit 1e9261312480e1adbede6c03ac63b7f733326dfb @adamwynne committed Oct 21, 2012
Showing with 29 additions and 1 deletion.
  1. +28 −1 README.md
  2. +1 −0 target/stale/dependencies
View
@@ -4,7 +4,34 @@ Wrapper for spymemcached to access kestrel as a memcached client
## Usage
-Use me
+```Clojure
+
+(:require [kestrel.client :as kestrel])
+
+;;create client
+(kestrel/default-client) ;; use default settings
+(def kestrel2 (kestrel/default-client :host "127.0.0.1" :port 22133))
+
+;;get version of current Kestrel
+(kestrel/get-version)
+
+;;add and get values from Kestrel
+(kestrel/set-item "uris" "http://httpbin.org/ip")
+(kestrel/set-item "uris" "http://httpbin.org/delay/10")
+
+(kestrel/get-item "uris")
+(nil? (kestrel/get-item "uris")) ;; should be false
+(kestrel/get-item "uris") ;; should be nil
+
+;;flush queue
+(kestrel/flush-queue "uris")
+(kestrel/flush-all) ;its nice to start working on clean sheet
+
+;;get stat
+
+(kestrel/get-stats)
+
+```
## License
@@ -0,0 +1 @@
+([:dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"] [spy/spymemcached "2.7"]]])

0 comments on commit 1e92613

Please sign in to comment.