Created
July 1, 2014 21:07
-
-
Save avgerin0s/1a2f28002078358b0a8e to your computer and use it in GitHub Desktop.
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 redis-example.core | |
(:require [taoensso.carmine :as redis :refer (wcar)])) | |
(defmacro wcar* [& body] `(redis/wcar server-connection ~@body)) | |
(defn init-redis [] | |
(def server-connection {:pool {:max-active 1} | |
:spec { | |
:host "localhost" | |
:port 6379 | |
:timeout 4000}}) | |
(wcar* (redis/set "foo" "bar") | |
(redis/set "wat" "woot"))) | |
(defn get-value [k] | |
(wcar* (redis/get k))) | |
(defn set-value [k v] | |
(wcar* (redis/set k v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment