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

GatewayBot takes custom cache impl as constructor arg #977

Closed
wants to merge 1 commit into from
Closed

GatewayBot takes custom cache impl as constructor arg #977

wants to merge 1 commit into from

Conversation

ahnaf-zamil
Copy link
Contributor

@ahnaf-zamil ahnaf-zamil commented Jan 24, 2022

Summary

Added an optional constructor arg to hikari.GatewayBot which takes a cache.MutableCacheinstance. If provided, the _cache property is set to that value, or else it uses the default hikari cache implementation

Checklist

  • I have run nox and all the pipelines have passed.

Related issues

@@ -341,7 +342,7 @@ def __init__(

# Caching
cache_settings = cache_settings if cache_settings is not None else config.CacheSettings()
self._cache = cache_impl.CacheImpl(self, cache_settings)
self._cache = cache or cache_impl.CacheImpl(self, cache_settings)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you meant to pass a separate cache impl to the bot's init if you're going to need the bot instance to initiate most custom cache impls (esp any which extend the standard impl)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I forgot about that. Let me change that up on my next commit

@ahnaf-zamil
Copy link
Contributor Author

Closing since it's been decided that this feature is not needed/viable at the moment

@FasterSpeeding
Copy link
Collaborator

Some extra discussion around this can be found at https://canary.discord.com/channels/574921006817476608/644130410564943873/935018943775653958 if you have access to the contributor's discussion

@FasterSpeeding
Copy link
Collaborator

For ref I'm not sure this will be done but i'm leaving the issue and pr open for now for conversation around this idea

@FasterSpeeding
Copy link
Collaborator

Gonna close this for now as I don't see this being implemented properly in the forceable future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants