Fork me on GitHub
#clojure-dev
<
2018-02-26
>
noisesmith18:02:30

is it intentional that clojure.core.cache/ttl-cache-factory returns an object with no ttl data attached to it? this seems absurd

noisesmith18:02:15

I'm hoping I'm just using it wrong (binding [*print-meta* true] (prn (clj-cache/ttl-cache-factory {}))) => {} - where's the TTL?

noisesmith18:02:02

(binding [*print-meta* true] (prn (clj-cache/ttl-cache-factory {} :ttl 30000))) => {}

seancorfield18:02:38

@noisesmith Check the type -- it's a TTLCache object.

alexmiller18:02:00

I’ve been looking for someone to help maintain core.cache btw. If you’re interested, let me know. :)

alexmiller18:02:13

ideally someone actually using it for stuff

noisesmith18:02:36

seancorfield: oh! so weird, I didn't expect that, you are correct

seancorfield18:02:44

(type (cache/ttl-cache-factory {} :ttl 3000))
=> clojure.core.cache.TTLCache

noisesmith18:02:12

yeah, I just verified - the way it printed didn't make it obvious (I'm used to records and such with reader tags clearly)

seancorfield18:02:41

We use core.cache pretty heavily so I could take it on I guess @alexmiller -- I don't expect it actually needs much "maintenance"?

alexmiller18:02:09

iirc there are a few tickets out there that could probably use some attention

noisesmith18:02:12

it has open issues in jira

alexmiller18:02:34

I would be happy to have your help @seancorfield

seancorfield18:02:01

19 open issues (and a still-open pull request)... fair enough...

seancorfield18:02:56

And some pretty important ones open for three years... OK, sure. My wife's traveling a lot in March (China twice and Taiwan once, as well as an East Coast US trip) so I'll have plenty of alone time at weekends to work on it! Sign me up @alexmiller!

noisesmith18:02:42

would it be worth making a patch for the cache types to have reader tags in their printed representation?

seancorfield18:02:27

@noisesmith It would probably help folks trying to debug core.cache-using code.

seancorfield18:02:04

(I guess I'll have to roll my sleeves up and take a look this weekend!)

noisesmith18:02:59

I may be an outlier but it would also help my code - I normally use a database as the storage backend (instead of an in-memory atom or whatever), and encode / revive via the transit library. By accident my code happens to work even when I lose the custom cache types, but it would have broken if the db itself didn't enforce a ttl by deleting records.

seancorfield18:02:51

Feel free to open a JIRA issue outlining what you'd like to see 🙂

alexmiller20:02:32

@seancorfield fair warning that core.memoize tends to be pretty tightly coupled to core.cache as a consumer and usage

seancorfield20:02:09

Yup, and we use that heavily too.

seancorfield20:02:20

Who is maintaining memoize these days?

alexmiller20:02:47

or rather, I look at it occasionally but don’t have time to really do anything good with it

alexmiller20:02:07

would love to have someone handling that too :)

seancorfield20:02:31

Well, they go together so sign me up 🙂

alexmiller20:02:17

ok :) you won’t manage them any less than I am :)

seancorfield20:02:46

Hah! An underwhelming vote of confidence! 🙂

alexmiller20:02:54

oh, I’m confident you’ll do great. just saying that I have set the bar low for you. :)

alexmiller20:02:50

I’ve switched over jira and the build box to make you owner. let me know if you need anything else (I think github is probably ok already?)

seancorfield20:02:42

Thanks. Will ping you if I need anything else!