-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Message cache #595
Message cache #595
Conversation
Thanks, this looks solid already! |
34fea67
to
58f1dbc
Compare
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 |
aa64801
to
e9e6b2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an eviction count instead of always deleting the last message is pretty smart, nice!
I have a question, there is a lot of sorting going on, should we perhaps use an ordered_set
table instead to just have it sorted by the primary key out of the box?
2d838d6
to
24becdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid work!
I think I forgot to bring this up before: what do you think about using ordered_set
for the cache, such that the messages are sorted by message ID by default, and we do not need to sort results everywhere? This should also speed up culling old messages if I'm not wrong.
010fcab
to
f6bedde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice, thank you!!!!
Thanks! |
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.Adds a new Mnesia backed message cache, but defaults to a no-op cache for most users simply because it would use a lot more memory and most users don't need a message cache.
Also improves the way pluggable caching configuration works, such that users can provide a configuration to each cache, such as configuring a maximum size or how many messages get evicted when the cache reaches its maximum size