-
Notifications
You must be signed in to change notification settings - Fork 3
[Experiment]: Factory Pattern + Observability + JSDoc Types #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add types - Fix typescript configuration - Remove coverage tool - Remove outdated firebase test package (move towards Firebase tools) - Switch to pnpm
…f strategies, add queue management features including pause/resume and statistics, and enhance worker lifecycle tracking with heartbeats and concurrency
…nd queue pause/resume functionality.
…tured logging and metrics for task lifecycle events.
…er to factory functions and add error reporting to retry scheduler.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@AlbertSmit Make sure to base any pull request on |
Note
This is an experiment/brain-child exploring v2.0 improvements.
Not in a finished state. Welcome to discuss.
Overview
This PR introduces v2.0 of
@kaliber/firebase-queuewith breaking changes and significant improvements driven by real-world usage analysis.Why These Changes?
Usage Analysis
Analyzed 7 projects and 18 services:
Code Quality Issues
The original codebase had several code smells:
Queueusednewkeyword but was not a real constructor (nothis, weirdinstanceofcheck)process()was 155 lines with 6 nested functionsFeature Gap vs BullMQ
Breaking Changes⚠️
Factory functions instead of constructors:
Rationale: The old
new Queue()pattern was a pseudo-class that did not actually usethis- it was a factory function pretending to be a constructor. Converting to explicit factory functions makes the code honest and consistent.New Features ✨
🔴 P0: Retry with Backoff
Previously manually implemented in rabobank-jobs (~50 lines)
🟡 P1: Pause/Resume
Previously manually implemented in synchronization-service
Observability
Lifecycle Hooks
Queue Stats
Code Quality Improvements
task_helpers.js(smaller, focused functions)Testing