{"id":21948107,"url":"https://github.com/evolution-gaming/resource-pool","last_synced_at":"2025-07-29T03:08:28.670Z","repository":{"id":194960476,"uuid":"691945802","full_name":"evolution-gaming/resource-pool","owner":"evolution-gaming","description":"Pool of cats-effect resources","archived":false,"fork":false,"pushed_at":"2025-01-20T08:58:32.000Z","size":113,"stargazers_count":4,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T00:16:06.518Z","etag":null,"topics":["connection-pool","pool","resource","resource-pool","scala"],"latest_commit_sha":null,"homepage":"https://github.com/evolution-gaming/resource-pool","language":"Scala","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/evolution-gaming.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,"zenodo":null}},"created_at":"2023-09-15T08:17:40.000Z","updated_at":"2025-03-03T14:07:29.000Z","dependencies_parsed_at":"2023-10-04T20:40:35.940Z","dependency_job_id":"4351eabe-93db-4c89-bf9f-dae5b8bbcc71","html_url":"https://github.com/evolution-gaming/resource-pool","commit_stats":null,"previous_names":["evolution-gaming/resource-pool"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/evolution-gaming/resource-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fresource-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fresource-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fresource-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fresource-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evolution-gaming","download_url":"https://codeload.github.com/evolution-gaming/resource-pool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fresource-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267621599,"owners_count":24116900,"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-07-29T02:00:12.549Z","response_time":2574,"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":["connection-pool","pool","resource","resource-pool","scala"],"created_at":"2024-11-29T05:12:01.177Z","updated_at":"2025-07-29T03:08:28.614Z","avatar_url":"https://github.com/evolution-gaming.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resource-pool\n[![Build Status](https://github.com/evolution-gaming/resource-pool/workflows/CI/badge.svg)](https://github.com/evolution-gaming/resource-pool/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/evolution-gaming/resource-pool/badge.svg?branch=main)](https://coveralls.io/github/evolution-gaming/resource-pool?branch=main)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/879e88a4e6a94647848bc6b45788a9d7)](https://app.codacy.com/gh/evolution-gaming/resource-pool/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Version](https://img.shields.io/badge/version-click-blue)](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolution\u0026a=resource-pool_2.13\u0026repos=public)\n\nPool of [cats-effect](https://typelevel.org/cats-effect/) resources\n\n## Features:\n* allocates resources on demand up to configured limit\n* deallocates resources if not active for a configured time\n* tries to minimize number of resources in the pool\n* uses first-in-first-out queue for tasks\n* shuts down gracefully after completing accumulated tasks\n* tolerates resource failures\n* supports cancellation \n\n## Example \n\n```scala\nimport com.evolution.resourcepool.ResourcePool.implicits.*\n\ntrait Connection {\n  def query(): IO[Any]\n}\n\ndef connection: Resource[IO, Connection] = ???\n\nconnection\n  .toResourcePool( // you can convert any resource into the pool of resources\n    maxSize = 10, // it will create up to `maxSize` connections \n    expireAfter = 1.minute) // pool will release connection if it is not used for 1 minute\n  .use { connectionPool =\u003e\n    connectionPool\n      .resource // this will get first available connection or allocate one\n      .use { connection =\u003e\n        connection.query() // here you have access to the connection\n      }\n  }\n```\n\n## Setup\n\n```scala\naddSbtPlugin(\"com.evolution\" % \"sbt-artifactory-plugin\" % \"0.0.2\")\n\nlibraryDependencies += \"com.evolution\" %% \"resource-pool\" % \"1.0.2\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fresource-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolution-gaming%2Fresource-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fresource-pool/lists"}