{"id":31213781,"url":"https://github.com/celrenheit/chunkgroup","last_synced_at":"2025-09-21T08:46:56.741Z","repository":{"id":278536901,"uuid":"935943652","full_name":"celrenheit/chunkgroup","owner":"celrenheit","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-20T09:59:16.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T10:30:22.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/celrenheit.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":"2025-02-20T09:20:53.000Z","updated_at":"2025-02-20T09:59:19.000Z","dependencies_parsed_at":"2025-02-20T10:30:49.001Z","dependency_job_id":"b9647d6e-c277-4eb0-8edb-4e013654b9de","html_url":"https://github.com/celrenheit/chunkgroup","commit_stats":null,"previous_names":["celrenheit/chunkgroup"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/celrenheit/chunkgroup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fchunkgroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fchunkgroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fchunkgroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fchunkgroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celrenheit","download_url":"https://codeload.github.com/celrenheit/chunkgroup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fchunkgroup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276216318,"owners_count":25604726,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-21T08:46:55.365Z","updated_at":"2025-09-21T08:46:56.735Z","avatar_url":"https://github.com/celrenheit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chunkgroup\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/celrenheit/chunkgroup)](https://pkg.go.dev/github.com/celrenheit/chunkgroup)\n[![Go Report Card](https://goreportcard.com/badge/github.com/celrenheit/chunkgroup)](https://goreportcard.com/report/github.com/celrenheit/chunkgroup)\n![GitHub](https://img.shields.io/github/license/celrenheit/chunkgroup)\n\nPackage chunkgroup provides a way to schedule the execution of a function when a chunk of data is ready.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/celrenheit/chunkgroup\"\n)\n\nfunc main() {\n\tcg := chunkgroup.New(10, 5, func(items []int) error {\n\t\tfmt.Println(items)\n\t\treturn nil\n\t})\n\n\tfor i := range 105 {\n\t\tcg.Add(i)\n\t}\n\n\tif err := cg.Flush(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nThis should output something like this (order may be different due to concurrency being over 1):\n```\n[40 41 42 43 44 45 46 47 48 49]\n[30 31 32 33 34 35 36 37 38 39]\n[50 51 52 53 54 55 56 57 58 59]\n[10 11 12 13 14 15 16 17 18 19]\n[70 71 72 73 74 75 76 77 78 79]\n[0 1 2 3 4 5 6 7 8 9]\n[60 61 62 63 64 65 66 67 68 69]\n[20 21 22 23 24 25 26 27 28 29]\n[100 101 102 103 104]\n[90 91 92 93 94 95 96 97 98 99]\n[80 81 82 83 84 85 86 87 88 89]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fchunkgroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelrenheit%2Fchunkgroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fchunkgroup/lists"}