Oh wow, sorry- I didn't see your reply in time and for some reason
figured you were using clj-redis.
This is actually easier since (if I recall correctly) redis-clojure is
able to write byte[]s and has an as-bytes macro for reading.
So you'd want something like this (untested):
(defn thaw [k]
(redis/with-server {:host "dev-1" :port 6379 :db 0}
(let [j (redis/as-bytes (redis/hget k k))]
(if (nil? j)
(do
(info (str "Not found in redis cache " k))
nil)
(do
(info (str "Thawed from redis cache " k))
(df/thaw-from-array j))))))
(defn freeze [k results]
(redis/with-server {:host "dev-1" :port 6379 :db 0}
(redis/hmset k k (df/freeze-to-array results))))
--
Peter
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en