Liking cljdoc? Tell your friends :D

cachify.core


*cache-list*clj

source

cachifyclj

(cachify func-name func & {:keys [ttl] :or {ttl (tm/seconds 60)}})

Returns the function with a cache

e.g. (defn plus [a b] (println a "+" b) (+ a b)) (def cached-plus (cachify :plus plus)) (cached-plus 1 2) ; print "1 + 2" and return 3 (cached-plus 1 2) ; return 3

Returns the function with a cache

e.g.
(defn plus [a b]
  (println a "+" b)
  (+ a b))
(def cached-plus (cachify :plus plus))
(cached-plus 1 2) ; print "1 + 2" and return 3
(cached-plus 1 2) ; return 3
sourceraw docstring

defcachifycljmacro

(defcachify name & body)

Define cachified function

e.g. (defcachify plus [a b] (println a "+" b) (+ a b)) (cached-plus 1 2) ; print "1 + 2" and return 3 (cached-plus 1 2) ; return 3

Define cachified function

e.g.
(defcachify plus [a b]
  (println a "+" b)
  (+ a b))
(cached-plus 1 2) ; print "1 + 2" and return 3
(cached-plus 1 2) ; return 3
sourceraw docstring

permclj

(perm)
(perm caches)

Write caches to files

e.g. (defcachify plus [a b] (+ a b)) (defn -main [] (println (plus 1 2)) (println (plus 1 2)) ; ... (perm)

Write caches to files

e.g.
(defcachify plus [a b] (+ a b))
(defn -main []
  (println (plus 1 2))
  (println (plus 1 2))
  ; ...
  (perm)
sourceraw docstring

perm-1clj

(perm-1 cache)

Write a cache to a file

Write a cache to a file
sourceraw docstring

perm-on-exitclj

(perm-on-exit)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close