{"id":15490773,"url":"https://github.com/theodesp/go-object-pool","last_synced_at":"2025-04-22T19:11:00.048Z","repository":{"id":97066526,"uuid":"115915890","full_name":"theodesp/go-object-pool","owner":"theodesp","description":"Simple and efficient implementation of a generic Object Pool in Go","archived":false,"fork":false,"pushed_at":"2018-01-01T22:42:54.000Z","size":6,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T18:02:05.580Z","etag":null,"topics":["design-patterns","golang","object-pool","resource-pool"],"latest_commit_sha":null,"homepage":null,"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/theodesp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","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":"2018-01-01T11:48:14.000Z","updated_at":"2024-05-03T08:01:10.000Z","dependencies_parsed_at":"2023-04-22T21:15:34.567Z","dependency_job_id":null,"html_url":"https://github.com/theodesp/go-object-pool","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/theodesp%2Fgo-object-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fgo-object-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fgo-object-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fgo-object-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theodesp","download_url":"https://codeload.github.com/theodesp/go-object-pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306638,"owners_count":21408926,"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":["design-patterns","golang","object-pool","resource-pool"],"created_at":"2024-10-02T07:24:02.235Z","updated_at":"2025-04-22T19:11:00.018Z","avatar_url":"https://github.com/theodesp.png","language":"Go","readme":"go-object-pool\n---\n\u003ca href=\"https://godoc.org/github.com/theodesp/go-object-pool\"\u003e\n\u003cimg src=\"https://godoc.org/github.com/theodesp/go-object-pool?status.svg\" alt=\"GoDoc\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"\u003e\n\u003cimg src=\"https://img.shields.io/github/license/mashape/apistatus.svg\" alt=\"License\"/\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://travis-ci.org/theodesp/go-object-pool\" rel=\"nofollow\"\u003e\n\u003cimg src=\"https://travis-ci.org/theodesp/go-object-pool.svg?branch=master\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/theodesp/go-object-pool\"\u003e\n  \u003cimg src=\"https://codecov.io/gh/theodesp/go-object-pool/branch/master/graph/badge.svg\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://ci.appveyor.com/project/theodesp/go-object-pool\" rel=\"nofollow\"\u003e\n  \u003cimg src=\"https://ci.appveyor.com/api/projects/status/7yiwtn68qmcj71xy?svg=true\" /\u003e\n\u003c/a\u003e\n\nThe object pool pattern is a software **creational \ndesign pattern** that uses a set of initialized objects \nkept ready to use – a \"pool\" – rather than allocating and \ndestroying them on demand. \nA client of the pool will request an object from the pool \nand perform operations on the returned object. \nWhen the client has finished, it returns the object \nto the pool rather than destroying it; \nthis can be done manually or automatically.\n\n## Installation\n```bash\n$ go get -u github.com/theodesp/go-object-pool\n```\n\n## Usage\n\nProvide the necessary interface implementations first and then\ncreate the Pool\n\n```go\ntype ByteBufferObject struct {\n\tbuffer *bytes.Buffer\n}\n\nfunc (b *ByteBufferObject) Reset() {\n\tb.buffer.Reset()\n}\n\ntype ByteBufferFactory struct{}\n\nfunc (f ByteBufferFactory) Create() (PooledObject, error) {\n\treturn \u0026ByteBufferObject{\n\t\tbuffer: bytes.NewBuffer(make([]byte, 1024)),\n\t}, nil\n}\n\nfactory := \u0026ByteBufferFactory{}\npool := NewFixedPool(16, factory)\n\nobj, _ := pool.Get()\npool.Return(obj)\n```\n\n\n## LICENCE\nCopyright © 2017 Theo Despoudis MIT license","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodesp%2Fgo-object-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheodesp%2Fgo-object-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodesp%2Fgo-object-pool/lists"}