Easy way to declare custom Cache
See original GitHub issueSummary
It would be nice if I could declare a cache class in CacheSettings. Currently you have to patch multiple things, including Bot._cache
and Bot._event_manager._cache
.
Why is this needed?
To add to or modify the default cache.
Ideal implementation
An extra setting in CacheSettings for cache class; it should expect a subclass of CacheImpl. Then it can set self._cache = cache_settings.cache_class(...)
, or something of the sort.
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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Tutorial: Creating a custom cache - HCL Product Documentation
Custom caches can take full advantage of the HCL Cache framework for caching locally and remotely ... Perform the following steps to create...
Read more >How to Create a Simple In Memory Cache in Java (Best ...
Crunchify Java and J2EE Tutorials How to Create a Simple In Memory Cache in Java (Best Lightweight Java ... How to Create a...
Read more >How to create a custom cache in Sitecore - Laub plus Co
The most basic usage of a custom cache is to use it for storing string values. Then you just call GetString and SetString...
Read more >Create custom cache keys - Cloudflare Docs
Under Then the settings are, choose Custom Cache Key from the dropdown. Click the appropriate Query String setting. (Optional) Click Advanced and enter ......
Read more >How to customize caches with Spring/ Spring Boot - Medium
We will implement a very simple (and dummy) cache and wire it to our business service. I used Kotlin as the implementation language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah that’s what I said in the last part of my reply. The
GatewayBot
could take in a cache impl as a constructor arg, and then use that. But at the moment, it’s hardcoded to use hikari’s default CacheImpl, and the only way to change it is to override_cache
and_event_manager._cache
.BTW this example would likely fall under #880 (although it’d never quite apply to messages since that cache store is always incomplete)