awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sindresorhus avatar

sindresorhus/p-queue

0
View on GitHub↗
4,217 stars·208 forks·TypeScript·MIT·7 views

P Queue

p-queue is a JavaScript promise queue and concurrent task scheduler designed to limit the number of active asynchronous operations. It serves as an asynchronous rate limiter and promise lifecycle manager to prevent resource exhaustion.

The project distinguishes itself through priority-based task scheduling and token-bucket rate limiting to control execution frequency. It integrates with abort signals for task cancellation and provides mechanisms to pause, resume, and clear pending operations.

The tool covers broader traffic management capabilities including operation timeouts and concurrency limiting. It also includes monitoring primitives to track queue state and pending task counts, as well as synchronization for queue idling.

Features

  • Asynchronous Task Schedulers - Provides a comprehensive system for dispatching and executing asynchronous tasks with priority and concurrency control.
  • Task Queues - Provides a JavaScript promise queue for managing asynchronous tasks with strict concurrency limits.
  • Token Bucket Implementations - Implements a token-bucket algorithm to cap the execution frequency of tasks over a fixed time window.
  • Queue Priority Scheduling - Supports priority-based task scheduling to ensure critical operations are processed before lower-priority ones.
  • Concurrency Semaphores - Uses semaphore-like logic to limit the number of active promises running simultaneously.
  • Concurrent Task Limiters - Caps the number of parallel tasks executing to manage system resource consumption.
  • Concurrent Task Schedulers - Ships a scheduler that controls the number of active promises and manages task priority and timeouts.
  • Task Priority Execution - Implements priority levels for tasks to ensure that critical work is executed before lower-priority operations.
  • Rate Limiters - Implements application-level rate limiting using token bucket and fixed window algorithms.
  • Concurrency Limiting - Restricts the number of concurrent asynchronous operations to prevent system resource exhaustion.
  • Queue Pause and Resume Controls - Allows the queue to be paused and resumed to synchronize background work with application state.
  • Graceful Queue Draining - Provides a promise that resolves only after all active and pending tasks are fully processed.
  • AbortSignal Cancellations - Integrates with AbortSignals to allow both pending and active tasks to be cancelled immediately.
  • AbortSignal Integrations - Provides integration with standard browser AbortSignals to trigger the immediate removal or termination of pending tasks.
  • Async Operation Timeouts - Provides the ability to set maximum execution durations for queued tasks to prevent hanging operations.
  • Idle State Synchronization - Provides a synchronization mechanism that resolves promises only after the queue is empty and all active tasks finish.
  • API Rate Limiting - Controls the frequency of outgoing network requests to comply with external API rate limits.
  • Promise Lifecycle Managers - Manages the lifecycle of promises including the ability to pause, resume, and clear pending operations.
  • Concurrency Control - Manage promise execution with concurrency control.
  • Promise Utilities - Manages promise execution with concurrency control.
  • Works with AVA - Listed in the “Works with AVA” section of the Awesome Ava awesome list.

Star history

Star history chart for sindresorhus/p-queueStar history chart for sindresorhus/p-queue

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does sindresorhus/p-queue do?

p-queue is a JavaScript promise queue and concurrent task scheduler designed to limit the number of active asynchronous operations. It serves as an asynchronous rate limiter and promise lifecycle manager to prevent resource exhaustion.

What are the main features of sindresorhus/p-queue?

The main features of sindresorhus/p-queue are: Asynchronous Task Schedulers, Task Queues, Token Bucket Implementations, Queue Priority Scheduling, Concurrency Semaphores, Concurrent Task Limiters, Concurrent Task Schedulers, Task Priority Execution.

What are some open-source alternatives to sindresorhus/p-queue?

Open-source alternatives to sindresorhus/p-queue include: jhalterman/failsafe — Failsafe is a JVM resilience library providing a collection of fault tolerance patterns for Java applications. It… taskforcesh/bullmq — BullMQ is a Redis-backed message queue library and background processor designed for distributed task queueing. It… ruby-concurrency/concurrent-ruby — Concurrent Ruby is a comprehensive concurrency toolkit for the Ruby language that provides thread-safe data… jeffail/tunny — Tunny is a worker pool library and concurrency manager for Go. It functions as a concurrent task scheduler that limits… stephencleary/asyncex — AsyncEx is a .NET asynchronous synchronization library providing a collection of primitives to coordinate tasks and… bogdanp/dramatiq — Dramatiq is a distributed task queue and workload manager used to offload function execution to background workers. It…

Open-source alternatives to P Queue

Similar open-source projects, ranked by how many features they share with P Queue.
  • jhalterman/failsafejhalterman avatar

    jhalterman/failsafe

    4,307View on GitHub↗

    Failsafe is a JVM resilience library providing a collection of fault tolerance patterns for Java applications. It functions as an asynchronous execution wrapper that runs tasks in the background and returns futures to prevent thread blocking. The library allows for the composition of resilience policies, enabling multiple patterns to be stacked into a sequential pipeline. It includes specific implementations for circuit breaking to prevent system overload, rate limiting to control traffic flow, and a framework for managing retries and fallbacks. Capability areas cover traffic management thro

    Java
    View on GitHub↗4,307
  • taskforcesh/bullmqtaskforcesh avatar

    taskforcesh/bullmq

    8,432View on GitHub↗

    BullMQ is a Redis-backed message queue library and background processor designed for distributed task queueing. It functions as a distributed queue manager and task scheduler, utilizing Redis to manage asynchronous job processing and persistence. The system distinguishes itself through its role as a job workflow orchestrator, enabling the definition of complex parent-child job dependencies and hierarchies for multi-step workflows. It provides sandboxed process execution to isolate heavy workloads and prevent event loop blocking, alongside distributed rate limiting to protect downstream servic

    TypeScriptbackground-jobselixirnodejs
    View on GitHub↗8,432
  • jeffail/tunnyJeffail avatar

    Jeffail/tunny

    4,033View on GitHub↗

    Tunny is a worker pool library and concurrency manager for Go. It functions as a concurrent task scheduler that limits the number of parallel workers processing jobs to prevent system resource exhaustion. The project enables the maintenance of persistent state within individual worker routines to avoid repeated initialization costs. It also supports dynamic worker scaling, allowing the number of active background workers to be adjusted in real time without interrupting tasks in progress. The library provides mechanisms for task timeout enforcement and worker lifecycle management, including t

    Gogogolanggoroutine-pool
    View on GitHub↗4,033
  • ruby-concurrency/concurrent-rubyruby-concurrency avatar

    ruby-concurrency/concurrent-ruby

    5,830View on GitHub↗

    Concurrent Ruby is a comprehensive concurrency toolkit for the Ruby language that provides thread-safe data structures, synchronization primitives, and asynchronous execution patterns. It implements core concurrency abstractions including an actor model framework where isolated actors communicate through asynchronous message passing, a future and promise system for composing non-blocking operations, and thread pool executors that manage reusable worker threads for concurrent task execution. The library distinguishes itself through a broad set of coordination mechanisms that go beyond basic th

    Ruby
    View on GitHub↗5,830
See all 30 alternatives to P Queue→