Re: easy clojure.core.cache interaction

2015-06-11 Thread Ryan Waters
Also worth mentioning is that the implementation is many-thread friendly, so using a cache: 1) won't be a single thread bottleneck (as in the case of using an unadorned agent) 2) work is done on the calling threads Granted, there's a race condition where two threads trying to find the same thing a

easy clojure.core.cache interaction

2015-06-11 Thread Ryan Waters
https://gist.github.com/rwat/4abcebcb4cfae956f382 I've enjoyed using clojure.core.cache for caching results from time expensive operations involving I/O, etc. and feel like this is the sort of function that makes c.c.cache as simple to use as possible. e.g. all it becomes is: (cache-interact c f