Skip to content

feat: scan delayed Redis tasks incrementally - #851

Open
ShivangiRay wants to merge 1 commit into
RichardKnop:masterfrom
ShivangiRay:codex/add-redis-delayed-task-scan
Open

feat: scan delayed Redis tasks incrementally#851
ShivangiRay wants to merge 1 commit into
RichardKnop:masterfrom
ShivangiRay:codex/add-redis-delayed-task-scan

Conversation

@ShivangiRay

Copy link
Copy Markdown

Summary

  • add an opt-in DelayedTaskScanner interface for cursor-based delayed-task reads
  • implement ScanDelayedTasks with Redis ZSCAN for the Redigo and go-redis brokers in v1 and v2
  • retain the existing GetDelayedTasks API for callers that need the complete queue

Why

GetDelayedTasks uses ZRANGE 0 -1, which materializes every delayed task. ZSCAN lets callers consume the queue in bounded batches using the returned cursor.

Validation

  • go test ./v1/brokers/redis ./v1/brokers/iface
  • (cd v2 && go test ./brokers/redis ./brokers/iface)
  • gofmt and git diff --check

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.

1 participant