{"id":13817101,"url":"https://github.com/fatih/pool","last_synced_at":"2026-01-10T03:49:00.134Z","repository":{"id":12178486,"uuid":"14778430","full_name":"fatih/pool","owner":"fatih","description":"Connection pool for Go's net.Conn interface","archived":true,"fork":false,"pushed_at":"2018-07-22T10:02:14.000Z","size":40,"stargazers_count":1363,"open_issues_count":0,"forks_count":292,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-10-17T07:52:15.071Z","etag":null,"topics":["go","golang","pool"],"latest_commit_sha":null,"homepage":"https://godoc.org/gopkg.in/fatih/pool.v2","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/fatih.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":"2013-11-28T14:02:50.000Z","updated_at":"2024-10-15T13:23:50.000Z","dependencies_parsed_at":"2022-07-21T21:32:44.467Z","dependency_job_id":null,"html_url":"https://github.com/fatih/pool","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatih%2Fpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatih%2Fpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatih%2Fpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatih%2Fpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fatih","download_url":"https://codeload.github.com/fatih/pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234563145,"owners_count":18853060,"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":["go","golang","pool"],"created_at":"2024-08-04T06:00:33.688Z","updated_at":"2025-09-28T21:31:08.939Z","avatar_url":"https://github.com/fatih.png","language":"Go","funding_links":[],"categories":["Misc","Go"],"sub_categories":[],"readme":"# Archived project. No maintenance. \nThis project is not maintained anymore and is archived. Feel free to fork and\nuse make your own changes if needed.\n\nThanks all for their work on this project. \n\n# Pool [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/fatih/pool) [![Build Status](http://img.shields.io/travis/fatih/pool.svg?style=flat-square)](https://travis-ci.org/fatih/pool)\n\n\nPool is a thread safe connection pool for net.Conn interface. It can be used to\nmanage and reuse connections.\n\n\n## Install and Usage\n\nInstall the package with:\n\n```bash\ngo get github.com/fatih/pool\n```\n\nPlease vendor the package with one of the releases: https://github.com/fatih/pool/releases.\n`master` branch is **development** branch and will contain always the latest changes.\n\n\n## Example\n\n```go\n// create a factory() to be used with channel based pool\nfactory    := func() (net.Conn, error) { return net.Dial(\"tcp\", \"127.0.0.1:4000\") }\n\n// create a new channel based pool with an initial capacity of 5 and maximum\n// capacity of 30. The factory will create 5 initial connections and put it\n// into the pool.\np, err := pool.NewChannelPool(5, 30, factory)\n\n// now you can get a connection from the pool, if there is no connection\n// available it will create a new one via the factory function.\nconn, err := p.Get()\n\n// do something with conn and put it back to the pool by closing the connection\n// (this doesn't close the underlying connection instead it's putting it back\n// to the pool).\nconn.Close()\n\n// close the underlying connection instead of returning it to pool\n// it is useful when acceptor has already closed connection and conn.Write() returns error\nif pc, ok := conn.(*pool.PoolConn); ok {\n  pc.MarkUnusable()\n  pc.Close()\n}\n\n// close pool any time you want, this closes all the connections inside a pool\np.Close()\n\n// currently available connections in the pool\ncurrent := p.Len()\n```\n\n\n## Credits\n\n * [Fatih Arslan](https://github.com/fatih)\n * [sougou](https://github.com/sougou)\n\n## License\n\nThe MIT License (MIT) - see LICENSE for more details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatih%2Fpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffatih%2Fpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatih%2Fpool/lists"}