Skip to content

First Release

Compare
Choose a tag to compare
@ori88c ori88c released this 25 Jan 23:34
· 5 commits to main since this release

Key Features ✨

  • Mutual Exclusiveness 🔒: Ensures the mutually exclusive execution of asynchronous tasks, either to prevent potential race conditions caused by tasks spanning across multiple event-loop iterations, or for performance optimization.
  • Graceful Termination ⏳: Await the completion of all currently pending and executing tasks using the waitForAllExistingTasksToComplete method. Example use cases include application shutdowns (e.g., onModuleDestroy in Nest.js applications) or maintaining a clear state between unit-tests.
  • Suitable for "check and abort" scenarios: The isAvailable getter indicator enables to skip or abort operations if the lock is currently held by another task.
  • High Efficiency ⚙️: Leverages the Node.js microtasks queue to serve tasks in FIFO order, eliminating the need for manually managing an explicit queue of pending tasks.
  • Comprehensive documentation 📚: The class is thoroughly documented, enabling IDEs to provide helpful tooltips that enhance the coding experience.
  • Tests 🧪: Fully covered by extensive unit tests.
  • No external runtime dependencies: Only development dependencies are used.
  • ES2020 Compatibility: The tsconfig target is set to ES2020.
  • TypeScript support.