Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to cache interface for checking whether a resource is internally "complete" #880

Open
1 task
FasterSpeeding opened this issue Nov 4, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@FasterSpeeding
Copy link
Collaborator

Summary

Add a method to the cache interface for checking whether a resources should be considered to be "complete" based on the current cache's config and impl detail.

Problem

Right now while consuming the cache a common practice is to try the cache and fallback to making a REST request if possible due to the complex nature of whether a resource will be "complete" or not.

This method provide a uniform easy way to introspect the cache to work out whether falling back to rest should be necessary for a resource or not (without having to dive into impl detail of the cache yourself) since for an internally "complete" resource a None return means the entry doesn't exist unlike incomplete cache stores.

This should help with resources like the following resources where the completeness of the store will come down to internal configuration

  • Invites
  • Members
  • Possibly presences
  • Thread members

With the following resources always being incomplete and thus always returning False

  • Messages
  • Users
  • DM Channel IDs
  • Integrations (if they're ever added to the cache interface)

Ideal implementation

A method on the cache interface for checking whether a resource should be considered to be "complete", this should account for the enabled cache components along with other impl specific configuration for that cache (e.g. the member cache mode once #878 is implemented).

Checklist

  • I have searched the issue tracker and have made sure it's not a duplicate.
    If it is a follow up of another issue, I have specified it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant