nostrum
nostrum copied to clipboard
Message cache
This is still a work in progress, but is the beginnings of a message cache for Nostrum.
Still needs to be hooked into the event handler and I need to test it.
Thanks, this looks solid already!
There is one problem with QLC that I wonder if we can contribute a smart fix for upstream: qlc:keysort will always sort the entire table (as a list) in memory, so it's not exactly efficient on big tables. For large message caches this would mean a temporary bloating of memory on every cull. For the other "sorted by age" queries I think it's fine.
Should we maybe change the cull of old messages somehow differently... I'm thinking.. maybe we can memorize the oldest message somehow, but then we have to somehow update it - how would that work - or we need to, hm, I wonder
Still need to do some real testing of it myself but other than that, this should be ready.
Do note that there are breaking changes that come with this
Thanks!