{"id":37124214,"url":"https://github.com/practo/gobatch","last_synced_at":"2026-01-14T14:20:42.840Z","repository":{"id":57537894,"uuid":"286400044","full_name":"practo/gobatch","owner":"practo","description":"Batch Processing","archived":false,"fork":true,"pushed_at":"2020-08-22T08:59:24.000Z","size":1096,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T05:15:58.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"herryg91/gobatch","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/practo.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}},"created_at":"2020-08-10T06:57:00.000Z","updated_at":"2024-03-31T15:57:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/practo/gobatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/practo/gobatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/practo%2Fgobatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/practo%2Fgobatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/practo%2Fgobatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/practo%2Fgobatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/practo","download_url":"https://codeload.github.com/practo/gobatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/practo%2Fgobatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-14T14:20:42.011Z","updated_at":"2026-01-14T14:20:42.826Z","avatar_url":"https://github.com/practo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gobatch\n\nSimple batch library for Golang.\n\n## How to Use\n\nInstall:\n\n```\ngo get github.com/herryg91/gobatch\n```\n\nExample:\n\n```\nfunc fn1(workerID int, datas []interface{}) (err error) {\n    //do something\n    return\n}\n\n// every 100 datas or 15 second no activity, batch will be processed (fn1 will be run) with 2 worker\nmBatch := gobatch.NewMemoryBatch(fn1, 100, time.Second*15, 2)\n\nmBatch.Insert(interface{}{})\nmBatch.Insert(interface{}{})\nmBatch.Insert(interface{}{})\n```\n\nNeed additional param to DoFn? You can do something like this\n```\ntype additionalParam struct {\n\tRedisPool *redis.Pool\n}\n\nfunc (p additionalParam) fn1(workerID int, datas []interface{}) (err error) {\n\t// do something log.Println(p)\n\treturn\n}\n\nmBatch := gobatch.NewMemoryBatch(additionalParam{pool}.fn1, 100, time.Second*15, 2)\n\n```\n\n## Future Update:\n- Batch using Redis\n- Batch using File\n- Add / Decrease Worker on the fly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpracto%2Fgobatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpracto%2Fgobatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpracto%2Fgobatch/lists"}