﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32076	Adding async methods to BaseCache	Andrew Chen Wang	nobody	"I've recently created a new package for Redis and Django integration at [https://github.com/Andrew-Chen-Wang/django-async-redis django-async-redis]. I'd like to add the missing methods, e.g. `get_async` or `set_async` to the BaseCache so people can get type hints or autocompletion suggestions when using `django.core.cache.cache` with async. 

Additionally, in order to be compatible with the async methods, there would need to be a new async method for closing cache connections/pools at [https://github.com/django/django/blob/999cddd58d30469f3ee85278985313fdf528323d/django/core/cache/__init__.py#L116-L121 django.core.cache.backends.base]. I believe the only good solution to that would be:


{{{
async def close_caches_async(**kwargs):
    # Some caches -- python-memcached in particular -- need to do a cleanup at the
    # end of a request cycle. If not implemented in a particular backend
    # cache.close is a no-op
    for cache in caches.all():
        await cache.close_async()
}}}


Please let me know if that is out of scope though. I also believe implementing async methods for the current backends is also out of scope of this ticket (and my time :P).

For reference, the Google Group Discussion: [https://groups.google.com/forum/#!topic/django-developers/sGq5Bnc2JMg here] and [https://groups.google.com/forum/#!topic/django-developers/NX03LNahZPo here]"	New feature	new	Core (Cache system)	3.1	Normal		cache		Unreviewed	0	0	0	0	0	0
