I want to memoize a function return that a function makes a http request to an API.
I'm unable to do it.
(defn _get_userid
[id cid]
(p1.nms2/get_uerid id cid))
(def get_userid
(memo/ttl _get_userid
{}
:ttl/threshold p1.constant/ttl-millisecs))
ttlfunction appears correct github.com/clojure/core.memoize/blob/master/src/main/clojure/… could you add the usage, actual output, and expected output to your question?memo. Also "I'm unable to do it." is not giving any hints, what is going wrong. Please add a clear statement of the problem you are facing.p1.nms2/get_ueridfunction, so a memoize there doesn't really make sense if you want different cid's to be cached under the same memoized function. Almost definitely the answer here is to create another function that only takes the parameter you care about and then memoize that. However it would be much more clear if you updated your question with your usage, your expected output, and your actual output