{"id":20148220,"url":"https://github.com/chainguard-dev/go-workqueue","last_synced_at":"2025-05-06T21:34:33.161Z","repository":{"id":253726673,"uuid":"844334681","full_name":"chainguard-dev/go-workqueue","owner":"chainguard-dev","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-04T19:13:05.000Z","size":149,"stargazers_count":3,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-06T02:48:56.410Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainguard-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-19T03:25:12.000Z","updated_at":"2024-09-04T19:13:09.000Z","dependencies_parsed_at":"2024-08-19T04:46:17.460Z","dependency_job_id":"a902a66e-2a9f-461a-a37f-04757f6888eb","html_url":"https://github.com/chainguard-dev/go-workqueue","commit_stats":null,"previous_names":["mattmoor/go-workqueue"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fgo-workqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fgo-workqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fgo-workqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fgo-workqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainguard-dev","download_url":"https://codeload.github.com/chainguard-dev/go-workqueue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224536816,"owners_count":17327683,"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-11-13T22:35:41.410Z","updated_at":"2024-11-13T22:35:43.768Z","avatar_url":"https://github.com/chainguard-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-workqueue\n\nThis is a Go library that can be used to queue and process work with a number of\nproperties reminiscient of Kubernetes Controller's workqueue, but that\nsupport being backed by durable storage (e.g. GCS, S3).\n\nGiven a `workqueue.Interface` new keys can be added to the queue with\ndeduplication by simply calling `Queue(ctx, key)`.  For example:\n\n```go\nfunc foo(ctx context.Context, wq workqueue.Interface) error {\n    if err := wq.Queue(ctx, \"foo\"); err != nil {\n        return err\n    }\n    if err := wq.Queue(ctx, \"bar\"); err != nil {\n        return err\n    }\n    if err := wq.Queue(ctx, \"baz\"); err != nil {\n        return err\n    }\n    return nil\n}\n```\n\nUp to `N` items of concurrent work may be processed from the workqueue by\ninvoking the `Handle` method in the\n`github.com/chainguard-dev/go-workqueue/dispatcher` package.  For example:\n\n```go\n\nif err := dispatcher.Handle(ctx, wq, N, func(ctx context.Context, key string) error {\n    // Process the key!\n    clog.InfoContextf(ctx, \"Got key: %s\", key)\n    return nil\n}); err != nil {\n    return err\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainguard-dev%2Fgo-workqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainguard-dev%2Fgo-workqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainguard-dev%2Fgo-workqueue/lists"}