{"repo":"earthboundkid/flowmatic","free":true,"listed":false,"github":"https://github.com/earthboundkid/flowmatic","clone":"git clone https://github.com/earthboundkid/flowmatic.git","description":"Structured concurrency made easy","language":"Go","stars":404,"topics":["concurrency","golang","goroutine","structured-concurrency","task-runner"],"license":"MIT","category":"dev-tools","readme_excerpt":"Flowmatic Flowmatic is a generic Go library that provides a structured approach to concurrent programming. It lets you easily manage concurrent tasks in a manner that is simple, yet effective and flexible. Flowmatic has an easy to use API with functions for handling common concurrency patterns. It automatically handles spawning workers, collecting errors, and propagating panics. Flowmatic requires Go 1.20+. Features - Has a simple API that improves readability over channels/waitgroups/mutexes - Handles a variety of concurrency problems such as heterogenous task groups, homogenous execution of a task over a slice, and dynamic work spawning - Aggregates errors - Properly propagates panics across goroutine boundaries - Has helpers for context cancelation - Few dependencies - Good test coverage How to use Flowmatic Execute heterogenous tasks One problem that Flowmatic solves is managing the execution of multiple tasks in parallel that are independent of each other. For example, let's say you want to send data to three different downstream APIs. If any of the sends fail, you want to return an error. With traditional Go concurrency, this can quickly become complex and difficult to manage, with Goroutines, channels, and sync.WaitGroup s to keep track of. Flowmatic makes it simple. To execute heterogenous tasks, just use flowmatic.Do : flowmatic stdlib To create a context for tasks that is canceled on the first error, use flowmatic.All . To create a context for tasks that is canceled","default_branch":null,"files":null,"tree":[],"storefront":"/r/earthboundkid","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/earthboundkid/flowmatic/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}