Skip to content

Conversation

@chrisguidry
Copy link
Owner

Consolidates Redis connection management into _redis.py as preparation for cluster support:

  • Add is_cluster_url() to detect redis+cluster:// URLs
  • Add redis_connection() context manager for getting Redis clients
  • Add pubsub_connection() context manager for pub/sub connections
  • Update Docket.redis() to use redis_connection()
  • Add Docket._pubsub() method for direct pub/sub access
  • Update worker and execution modules to use _pubsub()

All cluster URL paths raise NotImplementedError for now - actual cluster support will come in a future PR.

Also adds raise NotImplementedError to coverage exclusions since these are intentionally unreachable until cluster is implemented.

🤖 Generated with Claude Code

Consolidates Redis connection management into `_redis.py` as preparation
for cluster support:

- Add `is_cluster_url()` to detect `redis+cluster://` URLs
- Add `redis_connection()` context manager for getting Redis clients
- Add `pubsub_connection()` context manager for pub/sub connections
- Update `Docket.redis()` to use `redis_connection()`
- Add `Docket._pubsub()` method for direct pub/sub access
- Update worker and execution modules to use `_pubsub()`

All cluster URL paths raise `NotImplementedError` for now - actual
cluster support will come in a future PR.

Also adds `raise NotImplementedError` to coverage exclusions since
these are intentionally unreachable until cluster is implemented.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📚 Documentation has been built for this PR!

You can download the documentation directly here:
https://github.com/chrisguidry/docket/actions/runs/20764289333/artifacts/5042972717

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.96%. Comparing base (f45793d) to head (e90b425).

Files with missing lines Patch % Lines
src/docket/_redis.py 85.71% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##              main     #271      +/-   ##
===========================================
- Coverage   100.00%   99.96%   -0.04%     
===========================================
  Files           55       55              
  Lines         9074     9080       +6     
  Branches       450      453       +3     
===========================================
+ Hits          9074     9077       +3     
- Misses           0        3       +3     
Flag Coverage Δ
python-3.10 99.96% <95.71%> (-0.04%) ⬇️
python-3.11 98.70% <95.71%> (-0.04%) ⬇️
python-3.12 99.96% <95.71%> (-0.04%) ⬇️
python-3.13 99.96% <95.71%> (-0.04%) ⬇️
python-3.14 99.96% <95.71%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/docket/docket.py 100.00% <100.00%> (ø)
src/docket/execution.py 100.00% <100.00%> (ø)
src/docket/worker.py 100.00% <100.00%> (ø)
tests/test_worker_lifecycle.py 100.00% <100.00%> (ø)
src/docket/_redis.py 93.47% <85.71%> (-6.53%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Use simple `async with` instead of manual __aenter__/__aexit__ with
shield - the shield wasn't doing anything since we pass a connection
pool and auto_close_connection_pool is False.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants