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
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
RedisSessionwithredis-pymeans missing out on the dedicatedValkey-GLIDEclient, which is optimized for Valkey and will diverge fromredis-pyas Valkey adds its own features.Proposed solution
Add a
ValkeySessionclass following the same patterns asRedisSession. It should:valkey-glide(≥2.1) as the client libraryfrom_urlfactory method (valkey://, valkeys://, redis://, rediss://)References
Valkey-GLIDE Python client: https://github.com/valkey-io/valkey-glide