{"id":13753943,"url":"https://github.com/buptmiao/parallel","last_synced_at":"2026-01-28T13:31:53.619Z","repository":{"id":57486168,"uuid":"73340641","full_name":"buptmiao/parallel","owner":"buptmiao","description":"A golang parallel library, used for business logic aggregation and refactory without changing user function declaration.","archived":false,"fork":false,"pushed_at":"2024-12-23T04:39:03.000Z","size":15,"stargazers_count":82,"open_issues_count":2,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-09T21:36:20.853Z","etag":null,"topics":["golang","microservice","parallel","programming-model"],"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/buptmiao.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,"zenodo":null}},"created_at":"2016-11-10T02:39:26.000Z","updated_at":"2024-12-23T04:39:07.000Z","dependencies_parsed_at":"2025-05-09T21:36:22.591Z","dependency_job_id":"55a21ce4-6710-4028-a61c-82410e46c93f","html_url":"https://github.com/buptmiao/parallel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/buptmiao/parallel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptmiao%2Fparallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptmiao%2Fparallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptmiao%2Fparallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptmiao%2Fparallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buptmiao","download_url":"https://codeload.github.com/buptmiao/parallel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptmiao%2Fparallel/sbom","scorecard":{"id":258496,"data":{"date":"2025-08-11","repo":{"name":"github.com/buptmiao/parallel","commit":"f65fe046b7b5c412d34bbc1bfc24d19c7c4bd057"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 2/10 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T10:13:27.419Z","repository_id":57486168,"created_at":"2025-08-17T10:13:27.419Z","updated_at":"2025-08-17T10:13:27.419Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","microservice","parallel","programming-model"],"created_at":"2024-08-03T09:01:35.397Z","updated_at":"2026-01-28T13:31:53.592Z","avatar_url":"https://github.com/buptmiao.png","language":"Go","readme":"### Parallel\n\n[![Build Status](https://travis-ci.org/buptmiao/parallel.svg?branch=master)](https://travis-ci.org/buptmiao/parallel)\n[![Coverage Status](https://coveralls.io/repos/github/buptmiao/parallel/badge.svg?branch=master)](https://coveralls.io/github/buptmiao/parallel?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/buptmiao/parallel)](https://goreportcard.com/report/github.com/buptmiao/parallel)\n\n[zh_CN](https://github.com/buptmiao/parallel/blob/master/README_CN.md)\n\nA golang parallel library, used for business logic aggregation and refactory without changing function declaration.\n\n### Install\n\n```\ngo get github.com/buptmiao/parallel\n```\n\n### Usage\n\n#### eg.1\nThere are three methods: testjobA, testjobB, testjobC, execute them in parallel:\n```go\nimport (\n\t\"github.com/buptmiao/parallel\"\n)\n\nfunc testJobA() string {\n\treturn \"job\"\n}\n\nfunc testJobB(x, y int) int {\n\treturn x + y\n}\n\nfunc testJobC(x int) int {\n\treturn -x\n}\n\nfunc main() {\n\tvar s string\n\tvar x, y int\n\n\tp := parallel.NewParallel()\n\n\tp.Register(testJobA).SetReceivers(\u0026s)\n\tp.Register(testJobB, 1, 2).SetReceivers(\u0026x)\n\tp.Register(testJobC, 3).SetReceivers(\u0026y)\n\t// block here\n\tp.Run()\n\n\tif s != \"job\" || x != 3 || y != -3{\n\t\tpanic(\"unexpected result\")\n\t}\n}\n```\n#### eg.2\n\nLet's see a little complex case, there are three parallel jobs: jobA, jobB, jobC and a final Job which aggregates the result. The final depends on jobA and middle which depends on jobB and jobC.\n\n```\njobA  jobB   jobC\n \\      \\     /\n  \\      \\   /\n   \\      middle\n    \\      /\n     \\    /\n     final\n```\n\nRefer to the [demo](https://github.com/buptmiao/parallel/tree/master/examples/demo1/demo.go) below:\n\n```go\nimport (\n\t\"github.com/buptmiao/parallel\"\n)\n\ntype middle struct {\n\tB int\n\tC int\n}\n\ntype testResult struct {\n\tA string\n\tM middle\n}\n\nfunc testJobA() string {\n\treturn \"job\"\n}\n\nfunc testJobB(x, y int) int {\n\treturn x + y\n}\n\nfunc testJobC(x int) int {\n\treturn -x\n}\n\nfunc testFinal(s *string, m *middle) testResult {\n\treturn testResult{\n\t\t*s, *m,\n\t}\n}\n\nfunc main() {\n\tvar m middle\n\tvar s string\n\tvar res testResult\n\n\tp := parallel.NewParallel()\n\n\t// Create a child 1\n\tchild1 := p.NewChild()\n\tchild1.Register(testJobA).SetReceivers(\u0026s)\n\n\t// Create another child 2\n\tchild2 := p.NewChild()\n\tchild2.Register(testJobB, 1, 2).SetReceivers(\u0026m.B)\n\tchild2.Register(testJobC, 2).SetReceivers(\u0026m.C)\n\n\tp.Register(testFinal, \u0026s, \u0026m).SetReceivers(\u0026res)\n\t// block here\n\tp.Run()\n\n\texpect := testResult{\n\t\t\"job\",\n\t\tmiddle{\n\t\t\t3, -2,\n\t\t},\n\t}\n\tif res != expect {\n\t\tpanic(\"unexpected result\")\n\t}\n}\n```\n\n#### eg.3\n\nBy default, Parallel will ignore panics of jobs. But parallel supports customized exception handler, which is used for dealing with unexpected panics. For example, alerting or logging.\n```go\n// handle the panic\nfunc exceptionHandler(topic string, e interface{}) {\n\tfmt.Println(topic, e)\n}\n\n// will panic\nfunc exceptionJob() {\n\tvar a map[string]int\n\t//assignment to entry in nil map\n\ta[\"123\"] = 1\n}\n\nfunc main() {\n\tp := parallel.NewParallel()\n\tp.Register(exceptionJob)\n\t// miss the last argument on purpose\n\tp.Except(exceptionHandler, \"topic1\")\n\tp.Run()\n}\n```\n#### [more examples](https://github.com/buptmiao/parallel/tree/master/examples)","funding_links":[],"categories":["golang"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuptmiao%2Fparallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuptmiao%2Fparallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuptmiao%2Fparallel/lists"}