{"id":16379897,"url":"https://github.com/robinbraemer/parallel","last_synced_at":"2025-07-16T08:34:32.594Z","repository":{"id":57623873,"uuid":"396811465","full_name":"robinbraemer/parallel","owner":"robinbraemer","description":"Tiny utility for gracefully running functions in parallel with multi-error returning.","archived":false,"fork":false,"pushed_at":"2023-12-15T17:51:41.000Z","size":5,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T15:54:29.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robinbraemer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-16T13:39:13.000Z","updated_at":"2023-01-12T19:27:29.000Z","dependencies_parsed_at":"2024-06-20T08:19:49.734Z","dependency_job_id":"b082f320-e621-42a7-aa00-da674eeb5b95","html_url":"https://github.com/robinbraemer/parallel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinbraemer%2Fparallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinbraemer%2Fparallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinbraemer%2Fparallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinbraemer%2Fparallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robinbraemer","download_url":"https://codeload.github.com/robinbraemer/parallel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184061,"owners_count":20897704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T03:49:53.939Z","updated_at":"2025-04-04T13:27:00.631Z","avatar_url":"https://github.com/robinbraemer.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# parallel\n`parallel` is a tiny utility package for running functions in parallel with error handling.\nYou can very easily orchestrate highly complex function executions that run in parallel or ordered fashion,\ncombine both and get a single standard Go error back that supports functions from Go's errors package like\n`errors.Is` and `errors.As`.\n\n## Install\n```bash\ngo get -u github.com/robinbraemer/parallel\n```\n\n## Example\n\nImagine you need to run multiple functions in parallel\nbut some of them in order. It would be quiet code heavy\nto do so in a clean manner.\n\nLuckily you can use the `parallel` package to de-complicate this:\n\n```go\nvar fns [][]Fn\n// ...\nerr := Ordered(\n    Parallel( // A\n        Parallel(fns[0]...), // 1\n        Parallel(fns[1]...), // 2\n        Parallel(fns[2]...), // 3\n    ), \n    Parallel(fns[3]...),  // B\n    Ordered(\n        Parallel(fns[5]...), // 4\n        Parallel(fns[6]...), // 5\n    ),  // C\n).Do()\n```\n\nThis is what happens:\n- Ordered runs A, B, C in unparalleled order and returns the first error encountered\n- `A` runs 3 slices of functions in parallel and block until all are finished\n- after `A` is done `B` runs functions in parallel\n- after `B` is done `C` runs functions in parallel\n- Ordered returns\n\nThat means `1-3` must complete before `A` returns and `B` is run and so forth.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinbraemer%2Fparallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinbraemer%2Fparallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinbraemer%2Fparallel/lists"}