Skip to content

Add ValkeySession provider for session memory #3017

@daric93

Description

@daric93

Description:

Problem

Organizations using Valkey — the Linux Foundation's open-source, Redis-compatible data store — have no first-class session provider in the SDK. While Valkey is wire-compatible with Redis, relying on RedisSession with redis-py means missing out on the dedicated Valkey-GLIDE client, which is optimized for Valkey and will diverge from redis-py as Valkey adds its own features.

Proposed solution

Add a ValkeySession class following the same patterns as RedisSession. It should:

  • Implement the Session protocol
  • Use valkey-glide (≥2.1) as the client library
  • Support from_url factory method (valkey://, valkeys://, redis://, rediss://)
  • Support TTL-based session expiration
  • Support injecting an existing GlideClient for connection reuse
  • Be registered in init.py with lazy import
  • Include unit tests, integration tests (testcontainers), and documentation

References

Valkey-GLIDE Python client: https://github.com/valkey-io/valkey-glide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions