Skip to content

feat: add pagination and task management APIs for external UI support#59

Merged
kalbhor merged 1 commit intomainfrom
feat/pagination-task-management
Dec 13, 2025
Merged

feat: add pagination and task management APIs for external UI support#59
kalbhor merged 1 commit intomainfrom
feat/pagination-task-management

Conversation

@kalbhor
Copy link
Owner

@kalbhor kalbhor commented Dec 13, 2025

This change adds pagination support for pending jobs and persistent task metadata storage to enable external UI/dashboard integrations.

Key additions:

  • Broker pagination: GetPendingWithPagination() and GetPendingCount() methods for efficient querying of large job queues (Redis & in-memory implementations)
  • Task metadata persistence: Results interface now stores registered task info (name, queue, concurrency) for discovery across server restarts
  • Server.GetTasks() refactored to pull from persistent store instead of in-memory map, enabling UI to discover available tasks
  • NATS broker returns "not supported" for pagination (consistent with existing behavior)

Implementation details:

  • Redis uses LRANGE/LLEN for pagination, MGET for batch task retrieval
  • In-memory broker uses slice-based pagination with proper bounds checking
  • All implementations validate offset/limit (max 10k items per page)
  • Task registration now persists TaskInfo to results backend via msgpack
  • GetPending() deprecated in favor of paginated version

Breaking changes: None (additive only)

This change adds pagination support for pending jobs and persistent task
metadata storage to enable external UI/dashboard integrations.

Key additions:
- Broker pagination: GetPendingWithPagination() and GetPendingCount() methods
  for efficient querying of large job queues (Redis & in-memory implementations)
- Task metadata persistence: Results interface now stores registered task info
  (name, queue, concurrency) for discovery across server restarts
- Server.GetTasks() refactored to pull from persistent store instead of
  in-memory map, enabling UI to discover available tasks
- NATS broker returns "not supported" for pagination (consistent with existing behavior)

Implementation details:
- Redis uses LRANGE/LLEN for pagination, MGET for batch task retrieval
- In-memory broker uses slice-based pagination with proper bounds checking
- All implementations validate offset/limit (max 10k items per page)
- Task registration now persists TaskInfo to results backend via msgpack
- GetPending() deprecated in favor of paginated version

Breaking changes: None (additive only)

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

Co-Authored-By: Claude <noreply@anthropic.com>
@kalbhor kalbhor force-pushed the feat/pagination-task-management branch from cda81d6 to a1fb11b Compare December 13, 2025 14:02
@kalbhor kalbhor merged commit bbcb840 into main Dec 13, 2025
2 checks passed
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