You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add pagination and task management APIs for external UI support (#59)
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)
0 commit comments