andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
502 stars 71 forks source link

Cache using sync map #387

Closed andersfylling closed 3 years ago

andersfylling commented 3 years ago

With this I'm deprecating the crs caching system. As it has become hard to maintain. I'll simplify the logic to use a sync.Map. Hopefully the sync.Map can be replaced with a interface such that people can inject something like ristretto or whatever (Though ristretto wouldn't be the best choice for this wrapper).

Just going to re-use all the logic for the previous cache and swap out crs and the redundant locks.

Note that this is just an experiment to figure out whether or not this is worth it. This is not set in stone.