You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
Motivation
Currently the library presents two options when accessing some data with a snowflake e.g. user, channel, guild, etc:
Get from cache via Cache
Fetch from the API
A common requirement is that the user needs to fetch some data by using the cache if it exists and the API if it doesn't.
Description
Add options keyword list to every function in Alchemy.Client which supports :cached. The default value is true. When true, fetch from the cache if it exists, otherwise carry out the API request. When false simply carry out the API request.
Legend + Cached already # Probably should be cached (if not already) & Maybe should be cached?
Note: I don't know what the library does to cache information that these methods would provide as they are received as events. I still think we should add caching of that information as that is done by many other bot libraries and there is no reason not to remember what Discord tells us. A few of the methods maybe we shouldn't cache depending on if there is an event which would tell us if that information changes (get_integrations?).
The text was updated successfully, but these errors were encountered:
Some of these APIs don't map 1:1 onto a caching Cache. function, but we should still try and pull stuff from the cache even if it means multiple calls.
Do you think all the methods I listed should have smart cache? On the topic of cache, I've noticed that member caching seems to be a little... non-existent. On what circumstances does a member get cached right now? The function Cache.load_guild_members also seems like it does nothing related to the cache.
Motivation
Currently the library presents two options when accessing some data with a snowflake e.g. user, channel, guild, etc:
Cache
A common requirement is that the user needs to fetch some data by using the cache if it exists and the API if it doesn't.
Description
Add
options
keyword list to every function inAlchemy.Client
which supports:cached
. The default value is true. When true, fetch from the cache if it exists, otherwise carry out the API request. When false simply carry out the API request.Affected Functions
Legend
+
Cached already#
Probably should be cached (if not already)&
Maybe should be cached?Note: I don't know what the library does to cache information that these methods would provide as they are received as events. I still think we should add caching of that information as that is done by many other bot libraries and there is no reason not to remember what Discord tells us. A few of the methods maybe we shouldn't cache depending on if there is an event which would tell us if that information changes (get_integrations?).
The text was updated successfully, but these errors were encountered: