Fork me on GitHub
#clojure
<
2023-01-02
>
m.q.warnock15:01:47

Multi-part[0] question: I'm writing a multiplayer web-client game (a sort of MUSH actually), and I currently have player-state in-memory, and write it to xtdb when a player's websocket closes. Q3. Having a LRU (or maybe TTL) cache of the player-state seems desirable. I've seen core.cache, but my use-case would require a hook that runs when an item is dropped from the cache (so I can write it to the db). Is there a way to do that (without forking core.cache) I'm not seeing, or another library that's more appropriate (or should I just roll my own; doesn't seem too time-consuming, but maybe I'm underestimating)

m.q.warnock15:01:59

0. Also multi-channel: I have three fairly intertwined questions, with the first two seeming most appropriate for #C03S1L9DN and the third firmly in #C03S1KBA2 territory. Apologies for not managing to decomplect them, but I don't see how, without losing important context.

Sam Ritchie17:01:46

If the core.cache state lives in an atom you could use add-watch!

😲 2
gratitude-thank-you 2
chrisn18:01:07

Also see a Java library named caffeine

gratitude-thank-you 2
Kees19:01:20

Hey there, quick question with selmer. Is there a builtin way or good workaround for the abbreviate filter to not break words? I.e, if abbreviating, just shrink until first whitespace found

Kees19:01:16

The filtering is already powerful enough I'd love to avoid manual string parsing if possible!