Jason Woltje
6b776a74d2
feat: add Valkey integration for task queue (closes #98)
- Add ioredis package dependency for Redis-compatible operations
- Create ValkeyModule as global NestJS module
- Implement ValkeyService with task queue operations:
- enqueue(task): Add tasks to FIFO queue
- dequeue(): Get next task and update to PROCESSING status
- getStatus(taskId): Retrieve task metadata and status
- updateStatus(taskId, status): Update task state (COMPLETED/FAILED)
- getQueueLength(): Monitor queue depth
- clearQueue(): Queue management utility
- healthCheck(): Verify Valkey connectivity
- Add TaskDto, EnqueueTaskDto, UpdateTaskStatusDto interfaces
- Implement TaskStatus enum (PENDING/PROCESSING/COMPLETED/FAILED)
- Add comprehensive test suite with in-memory Redis mock (20 tests)
- Integrate ValkeyModule into app.module.ts
- Valkey Docker Compose service already configured in docker-compose.yml
- VALKEY_URL environment variable already in .env.example
- Add detailed README with usage examples and API documentation
Technical Details:
- Uses FIFO queue (RPUSH/LPOP for strict ordering)
- Task metadata stored with 24-hour TTL
- Lifecycle hooks for connection management (onModuleInit/onModuleDestroy)
- Automatic retry with exponential backoff on connection errors
- Global module - no explicit imports needed
Tests verify:
- Connection initialization and health checks
- FIFO enqueue/dequeue behavior
- Status lifecycle transitions
- Concurrent task handling
- Queue management operations
- Complete task processing workflows
2026-01-29 23:25:33 -06:00
..
2026-01-29 20:30:57 -06:00
2026-01-29 20:15:33 -06:00
2026-01-29 21:29:53 -06:00
2026-01-29 20:30:20 -06:00
2026-01-29 23:05:39 -06:00
2026-01-28 16:06:34 -06:00
2026-01-29 20:30:57 -06:00
2026-01-29 20:30:57 -06:00
2026-01-28 15:07:04 -06:00
2026-01-29 21:29:53 -06:00
2026-01-29 21:01:45 -06:00
2026-01-29 20:15:33 -06:00
2026-01-29 20:14:27 -06:00
2026-01-29 19:28:31 -06:00
2026-01-29 17:42:49 -06:00
2026-01-29 19:38:18 -06:00
2026-01-28 16:24:25 -06:00
2026-01-29 20:30:57 -06:00
2026-01-29 20:30:20 -06:00
2026-01-29 16:59:26 -06:00
2026-01-29 23:25:33 -06:00
2026-01-29 23:09:20 -06:00
2026-01-29 21:30:01 -06:00
2026-01-28 16:24:25 -06:00
2026-01-28 16:06:34 -06:00
2026-01-29 23:25:33 -06:00
2026-01-28 13:31:33 -06:00
2026-01-29 12:29:21 -06:00