On Mon, Oct 22, 2012 at 12:05 PM, Michael Fogus <[email protected]> wrote:
> First, thanks for trying c.c.cache! The answer to your question is
> that the TTL cache implementation is non-destructive. The `evict`
> call returns the cache without the element, but does not remove it
> from the original cache.
In other words you need something like this:
(def c3 (atom (cache/ttl-cache-factory {:a 1} :ttl 20000)))
user=> @c3
{:a 1}
user=> (cache/has? @c3 :a)
true
user=> (cache/has? @c3 :a)
false
user=> @c3
{:a 1}
user=> (swap! c3 cache/evict :a)
{}
user=> @c3
{}
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
--
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