Skip to content

Add aclose() to BaseCacheBackend and the Redis and Memcached backends #243

Description

@allen0099

Only MemoryBackend has aclose(). The lifespan pattern in BACKENDS.md (await backend.aclose()) raises AttributeError on Redis and Memcached, users have to reach into backend.client, and redis-py warns about an unclosed client otherwise.

Proposal

A no-op async def aclose() on BaseCacheBackend; Redis awaits client.aclose(), Memcached runs client.close() in a worker thread. Optionally __aenter__/__aexit__. Document it for every backend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendsCache backends and their atomic primitivesenhancementNew feature or request

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions