A Go library providing a structured concurrency API to simplify parallel task management, error aggregation, and panic propagation.
Flowmatic is a generic Go library that provides a structured approach to concurrent programming. It simplifies managing parallel tasks by offering a clear API for common concurrency patterns, automatically handling workers, errors, and panics, which reduces boilerplate code compared to traditional Go primitives like channels and wait groups.
Go developers building applications that require robust concurrent task management, such as those implementing parallel API calls, worker pools, or dynamic task spawning with error aggregation and panic safety.
Developers choose Flowmatic over standard Go concurrency primitives because it centralizes control with a serial manager for concurrent tasks, making code reasoning simpler and avoiding the combinatorial state explosion typical in locking-based approaches, while providing built-in error aggregation and panic propagation.
Structured concurrency made easy
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Flowmatic collects errors from multiple concurrent tasks and returns them as a single error, eliminating the boilerplate of manual error channel management shown in stdlib comparisons.
It catches panics in worker goroutines and repropagates them to the parent, allowing for controlled recovery and preventing process crashes, as detailed in the note on panicking.
Provides clear functions like Do, Each, Map, and ManageTasks for common patterns, improving readability over traditional concurrency primitives with less code.
Includes All and Race for context management, automatically canceling on first error or success, which simplifies complex cancellation logic in parallel tasks.
TaskPool reduces boilerplate for worker pools, as demonstrated in comparisons with x/sync/errgroup examples, making pipeline implementations more concise.
The layer of abstraction may introduce slight performance overhead compared to hand-optimized concurrency patterns, though not explicitly measured in the README.
Flowmatic is tailored for structured concurrency patterns and may not handle all edge cases, potentially requiring fallback to standard Go concurrency for niche scenarios.
Adds a third-party library dependency to projects, which could be a concern for teams aiming to minimize external packages or adhere to strict dependency policies.