Repository navigation
Version 3 validates task payloads at the Redis boundary and waits for worker connections before reporting startup success.
Breaking changes:
- Every task requires a synchronous
parse(value: unknown)function. Enqueue and schedule calls validate the serialized payload; workers validate persisted payloads before calling handlers, and scheduler reads validate template data. - Import
defineTaskfrom@rhymiz/simple-tasks,runAllWorkersfrom@rhymiz/simple-tasks/runtime,closeAllQueuesfrom@rhymiz/simple-tasks/queues, and public types from@rhymiz/simple-tasks/types. runAllWorkers()returns commonTaskWorkerlifecycle handles and rejects if connections fail or exceedstartupTimeoutMs(10 seconds by default). No selected worker starts processing until all connections are ready.
The registry now retains task-specific types through worker factories without casts. Package checks install the npm tarball into a clean consumer and verify both runtime imports and TypeScript contracts.
Validated with BullMQ 5.58.8, 5.81.4, 6.0.0, and 6.3.4: build, typecheck, lint, 23 unit tests, installed package checks, Bun and Node Redis integration, scheduler E2E, and startup timeout/socket cleanup.