A Go library providing limited and unlimited goroutine pools for easier concurrent task handling and cancellation.
Pool is a Go library that implements both limited consumer goroutine pools and unlimited goroutine pools to simplify concurrent task execution and management. It provides a structured way to handle goroutines, making it easier to manage concurrency patterns, cancel operations, and process work in batches.
Go developers building concurrent applications who need to manage goroutine lifecycles, cancellation, and batch processing efficiently.
Developers choose Pool for its simple API that imposes no assumptions on usage, its support for both limited and unlimited pools that are interchangeable, and features like work unit cancellation, batch processing, and automatic panic recovery.
:speedboat: a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library makes no assumptions about usage, with a straightforward interface that reduces boilerplate code, as emphasized in the README's 'Dead simple to use' description.
Consumer goroutines that panic are automatically recovered, and errors are returned through results, preventing application crashes, a key feature highlighted in the README.
Offers both limited worker pools for controlled concurrency and unlimited pools for maximum parallelism, with the same API for easy swapping, as noted in the v3 advantages.
Supports cancelling individual work units or entire batches, allowing responsive task management, with benchmarks showing fast cancellation times in the README.
Developers must explicitly call WorkUnit.IsCancelled() after blocking operations, adding complexity and risk of missed checks, as warned in the README's important notes.
Forgetting to call batch.QueueComplete() after queuing work causes deadlocks, a common pitfall that the README explicitly cautions against, requiring careful attention.
Lacks built-in support for task prioritization, rate limiting, or integration with external systems, which might necessitate additional layers for complex use cases.