A TypeScript library providing prioritized blocking queues with whenReady support, designed to handle bottlenecks like authentication refresh. Version 1.2.3 is the current stable release; the library is actively maintained on GitHub. It offers multiple priority levels, deadlock warnings, and full TypeScript support. Unlike many queue libraries, it includes a whenReady queue that executes only after prioritized jobs finish, making it ideal for token refresh patterns.
npm install typescript-blocking-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a blocking queue with 2 priority levels, enqueues a prioritized job, and demonstrates whenReady execution.
Use queue.prioritized(0).enqueue(() => { /* no await */ }) instead of awaiting the returned promise inside the callback.Always pass an index: queue.prioritized(1).enqueue(...) for lower priority.
Use separate prioritzed queues if you need serial execution.
No fix needed.
Wrap enqueue calls in try/catch or handle errors within the callback.
Change to import { newPrioritizedBlockingQueue } from 'typescript-blocking-queue'.Do not await the enqueue promise; use queue.prioritized(0).enqueue(() => { ... }) without await.No dependency data recorded yet.