Releases: ori88c/zero-backpressure-fixed-window-promise-rate-limiter
Releases · ori88c/zero-backpressure-fixed-window-promise-rate-limiter
README enhancements and dev-dependency upgrade
- README Enhancements: Updated the coding example to include a more realistic real-world scenario for fetching large data sets, maintaining a memory complexity of O(max(page-size, semaphore-capacity)).
- Dev-dependency upgrade: Updated a dev-dependency to address potential vulnerabilities. Notably, this package has no runtime dependencies - only dev-dependencies.
README and Documentation improvements
Key Features
- README improvements: Adding a Table of Contents, and enhancing some sections with clarifications.
- Enhancing documentation of getter method
amountOfUncaughtErrors
.
README and Docs improvements
Key Features
- README: Adding API and Getter Methods sections.
- Docs improvements.
- Indentation adjustments.
Improved Unit Test performance
Key Features
- Unit Tests: Removed
Array.shift()
operations due to their O(n) time complexity, which negatively impacted execution time. - Unit Tests: Reduced some mock numeric values for improved performance.
v1.0.2
Key Features
- Unit Tests: Enhanced unit-tests for method
waitForAllExecutingTasksToComplete
, covering border scenarios which trigger dynamic slots allocation due to prolonged tasks (which span over multiple windows). Both FIFO and FILO completion orders are validated in separate tests, ensuring the instance retains references to all tasks, including those from previous windows. - Unit Tests: Converting indentation to 2 spaces instead 4.
README Refinements and Bugfix
Key Features
- README refinements.
- Bugfix:
waitForAllExecutingTasksToComplete
could resolve prematurely before all executing tasks were completed, due to an incorrect slot index choice when the initial slot capacity was reached.
First Release
Key Features ✨
- Fixed Window Policy: Windows are distinct and do not overlap. This approach has a low performance overhead, and can ensure an even distribution of tasks if a relatively short window duration is chosen.
- Backpressure Control: Ideal for job workers and background services. Concurrency control alone isn't sufficient to ensure stability and performance if backpressure control is overlooked. For example, when message queues are involved, overlooking backpressure control can lead to messages accumulating over a long period, potentially reaching their TTL.
- Graceful Termination: Await the completion of all currently executing tasks via the
waitForAllExecutingTasksToComplete
method. - High Efficiency ⚙️: All state-altering operations have a constant time complexity, O(1).
- Comprehensive documentation 📚: The class is thoroughly documented, enabling IDEs to provide helpful tooltips that enhance the coding experience.
- Robust Error Handling: Uncaught errors from background tasks triggered by
startExecution
are captured and can be accessed using theextractUncaughtErrors
method. - Fully covered by rigorous unit tests.
- Self-explanatory method names.
- No external runtime dependencies: Only development dependencies are used.
- ES2020 Compatibility: The
tsconfig
target is set to ES2020, ensuring compatibility with ES2020 environments. - TypeScript support.