{"id":15650416,"url":"https://github.com/general-cbic/poolex","last_synced_at":"2026-04-19T13:06:07.841Z","repository":{"id":65436336,"uuid":"564219300","full_name":"general-CbIC/poolex","owner":"general-CbIC","description":"A library for managing pools of workers","archived":false,"fork":false,"pushed_at":"2025-03-31T08:12:16.000Z","size":1415,"stargazers_count":67,"open_issues_count":8,"forks_count":6,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-03T12:51:32.613Z","etag":null,"topics":["elixir","elixir-library","hacktoberfest","poolboy","worker-pool"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/poolex/","language":"Elixir","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/general-CbIC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"general-CbIC"}},"created_at":"2022-11-10T08:51:45.000Z","updated_at":"2025-03-13T14:44:48.000Z","dependencies_parsed_at":"2023-10-02T08:47:42.049Z","dependency_job_id":"7cd3d27e-663e-43b2-bea8-7a5f716acf76","html_url":"https://github.com/general-CbIC/poolex","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.052631578947368474","last_synced_commit":"968058919d7f1775251aa4d7a9e265c5c49ab1c3"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/general-CbIC%2Fpoolex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/general-CbIC%2Fpoolex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/general-CbIC%2Fpoolex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/general-CbIC%2Fpoolex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/general-CbIC","download_url":"https://codeload.github.com/general-CbIC/poolex/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198448,"owners_count":20900079,"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":["elixir","elixir-library","hacktoberfest","poolboy","worker-pool"],"created_at":"2024-10-03T12:34:34.055Z","updated_at":"2026-04-01T23:54:45.362Z","avatar_url":"https://github.com/general-CbIC.png","language":"Elixir","funding_links":["https://github.com/sponsors/general-CbIC"],"categories":[],"sub_categories":[],"readme":"# Poolex\n\n![Build and tests workflow](https://github.com/general-CbIC/poolex/actions/workflows/ci-tests.yml/badge.svg)\n[![hex.pm version](https://img.shields.io/hexpm/v/poolex.svg?style=flat)](https://hex.pm/packages/poolex)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg?style=flat)](https://hexdocs.pm/poolex/)\n[![License](https://img.shields.io/hexpm/l/poolex.svg?style=flat)](https://github.com/general-CbIC/poolex/blob/main/LICENSE)\n[![Weekly Downloads](https://img.shields.io/hexpm/dw/poolex.svg?style=flat)](https://hex.pm/packages/poolex)\n[![Total Downloads](https://img.shields.io/hexpm/dt/poolex.svg?style=flat)](https://hex.pm/packages/poolex)\n[![Elixir Forum](https://img.shields.io/badge/Elixir_Forum-purple?style=flat\u0026logo=elixir)](https://elixirforum.com/t/poolex-a-library-for-managing-pools-of-workers/54800)\n\nPoolex is a library for managing pools of workers. Inspired by [poolboy](https://github.com/devinus/poolboy).\n\nSee the [Poolex Playground](https://poolex-playground.cbic-dev.com/) — interactive page to play with the library.\n\n\u003e [!IMPORTANT]  \n\u003e Documentation on GitHub corresponds to the current branch. For stable versions' docs see [Hexdocs](https://hexdocs.pm/poolex/).\n\n## Table of Contents\n\n\u003cimg alt=\"Poolex logo\" src=\"https://raw.githubusercontent.com/general-CbIC/poolex/develop/assets/poolex.png\" width=\"250\" height=\"250\" align=\"right\"/\u003e\n\n- [Poolex](#poolex)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Guides](#guides)\n  - [Used by](#used-by)\n  - [Contributions](#contributions)\n  - [Support the Project](#support-the-project)\n\n## Features\n\nPoolex makes working with worker pools easy and flexible:\n\n- 🚀 Start multiple pools and grab a free worker from anywhere in your app.\n- ⚡ Automatically spin up extra workers when the load grows.\n- 📊 Get built-in metrics to monitor and tune your pools.\n- 🛠️ Plug in your own logic for how workers and callers are managed.\n- ⏳ Delay worker shutdowns to save resources when creating workers is expensive.\n\n**Why choose `poolex` over `poolboy`?**\n  \n- Written in Elixir for a smoother experience in Elixir projects.\n- Actively maintained and focused on modern Elixir needs.\n- `poolboy` is a great library, but not actively maintained :crying_cat_face: ![Last poolboy commit](https://img.shields.io/github/last-commit/devinus/poolboy?style=flat)\n\n## Requirements\n\n| Library                 | Elixir     | Erlang/OTP |\n|-------------------------|------------|------------|\n| `\u003e= 1.4.0`              | `\u003e= 1.17`  | `\u003e= 25`    |\n| `1.3.0`                 | `\u003e= 1 .11` | `\u003e= 24`    |\n| from `0.1.0` to `1.2.1` | `\u003e= 1.7`   | `\u003e= 22`    |\n\n## Installation\n\nAdd `:poolex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:poolex, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Usage\n\nIn the most typical use of Poolex, you only need to start a pool of workers as a child of your application.\n\n```elixir\nchildren = [\n  {Poolex,\n    worker_module: SomeWorker,\n    workers_count: 5}\n]\n\nSupervisor.start_link(children, strategy: :one_for_one)\n```\n\nThen you can execute any code on the workers with `run/3`:\n\n```elixir\niex\u003e Poolex.run(SomeWorker, \u0026(is_pid?(\u00261)), checkout_timeout: 1_000)\n{:ok, true}\n```\n\nFor long-running operations where you need to hold onto a worker (like maintaining a database connection for a TCP session), use `acquire/2` and `release/2`:\n\n```elixir\niex\u003e {:ok, worker} = Poolex.acquire(SomeWorker)\niex\u003e # Use worker for as long as needed...\niex\u003e GenServer.call(worker, :some_operation)\niex\u003e Poolex.release(SomeWorker, worker)\n:ok\n```\n\nWorkers acquired with `acquire/2` are automatically cleaned up if your process crashes, preventing resource leaks. The implementation is safe against double-release and ensures workers can only be released by their owner process.\n\nA detailed description of the available configuration options and usage examples can be found in the [documentation](https://hexdocs.pm/poolex/getting-started.html).\n\n## Guides\n\n- [Getting Started](https://hexdocs.pm/poolex/getting-started.html)\n  - [Starting pool of workers](https://hexdocs.pm/poolex/getting-started.html#starting-pool-of-workers)\n  - [Poolex configuration options](https://hexdocs.pm/poolex/getting-started.html#starting-pool-of-workers)\n  - [Working with the pool](https://hexdocs.pm/poolex/getting-started.html#working-with-the-pool)\n- [Manual Worker Management](https://hexdocs.pm/poolex/manual-worker-management.html)\n  - [When to use acquire/release](https://hexdocs.pm/poolex/manual-worker-management.html#when-to-use-acquire-release)\n  - [Basic usage](https://hexdocs.pm/poolex/manual-worker-management.html#basic-usage)\n  - [Safety guarantees](https://hexdocs.pm/poolex/manual-worker-management.html#safety-guarantees)\n  - [Best practices](https://hexdocs.pm/poolex/manual-worker-management.html#best-practices)\n- [Migration from `:poolboy`](https://hexdocs.pm/poolex/migration-from-poolboy.html)\n- [Example of use](https://hexdocs.pm/poolex/example-of-use.html)\n  - [Defining the worker](https://hexdocs.pm/poolex/example-of-use.html#defining-the-worker)\n  - [Configuring Poolex](https://hexdocs.pm/poolex/example-of-use.html#configuring-poolex)\n  - [Using Poolex](https://hexdocs.pm/poolex/example-of-use.html#using-poolex)\n- [Working with metrics](https://hexdocs.pm/poolex/pool-metrics.html)\n  - [Pool size metrics](https://hexdocs.pm/poolex/pool-metrics.html#pool-size-metrics)\n  - [Integration with PromEx](https://hexdocs.pm/poolex/pool-metrics.html#integration-with-promex)\n- [Workers and callers implementations](https://hexdocs.pm/poolex/workers-and-callers-implementations.html)\n  - [Callers](https://hexdocs.pm/poolex/workers-and-callers-implementations.html#callers)\n  - [Workers](https://hexdocs.pm/poolex/workers-and-callers-implementations.html#workers)\n  - [Writing custom implementations](https://hexdocs.pm/poolex/workers-and-callers-implementations.html#writing-custom-implementations)\n- [Controlling Pool Size with `min_pool_size` and `max_pool_size`](https://hexdocs.pm/poolex/min-and-max-pool-size.html)\n  - [Setting an upper bound with `max_pool_size`](https://hexdocs.pm/poolex/min-and-max-pool-size.html#setting-an-upper-bound-with-max-pool-size)\n  - [Setting a lower bound with `min_pool_size`](https://hexdocs.pm/poolex/min-and-max-pool-size.html#setting-a-lower-bound-with-min-pool-size)\n  - [Using both options together](https://hexdocs.pm/poolex/min-and-max-pool-size.html#using-both-options-together)\n  - [Partial execution](https://hexdocs.pm/poolex/min-and-max-pool-size.html#partial-execution)\n- [Using `worker_shutdown_delay` for Overflow Workers](https://hexdocs.pm/poolex/worker-shutdown-delay.html)\n  - [What are overflow workers?](https://hexdocs.pm/poolex/worker-shutdown-delay.html#what-are-overflow-workers)\n  - [The problem with immediate overflow worker shutdown](https://hexdocs.pm/poolex/worker-shutdown-delay.html#the-problem-with-immediate-overflow-worker-shutdown)\n  - [Solution: Delayed shutdown of overflow workers](https://hexdocs.pm/poolex/worker-shutdown-delay.html#solution-delayed-shutdown-of-overflow-workers)\n  - [Example usage](https://hexdocs.pm/poolex/worker-shutdown-delay.html#example-usage)\n  - [How it works](https://hexdocs.pm/poolex/worker-shutdown-delay.html#how-it-works)\n  - [When to use](https://hexdocs.pm/poolex/worker-shutdown-delay.html#when-to-use)\n  - [Default value](https://hexdocs.pm/poolex/worker-shutdown-delay.html#default-value)\n\n## Used by\n\n[![Aviasales](https://raw.githubusercontent.com/general-CbIC/poolex/develop/assets/companies/aviasales_logo.svg)](https://aviasales.tp.st/VlJlf7Ar)\n\n\u003c!-- ## Sponsored by\n\nNOTE: Commented cause I'm not sure if the ads are allowed :shrug:\n\n[![Sponsored by GitAds](https://gitads.dev/v1/ad-serve?source=general-cbic/poolex@github)](https://gitads.dev/v1/ad-track?source=general-cbic/poolex@github) --\u003e\n\n## Contributions\n\nIf you think something can be improved or have any questions about specific behaviors or implementation details, please feel free to file an issue. Proposed changes should be discussed in issues before submitting any PRs, to avoid spending time on code that might not be merged upstream.\n\nIf you are ready to change the project, please read the [Contributing guide](docs/CONTRIBUTING.md) first.\n\n## Support the Project\n\nIf you find Poolex useful, please consider supporting its development! You can:\n\n- ⭐ Star the project on [GitHub](https://github.com/general-CbIC/poolex)\n- 💖 Sponsor the author on [GitHub Sponsors](https://github.com/sponsors/general-CbIC)\n\nYour support helps keep the project active and maintained. Thank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneral-cbic%2Fpoolex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneral-cbic%2Fpoolex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneral-cbic%2Fpoolex/lists"}