All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.2.0 - 2025-01-07
- Added Elixir 1.18.* support to CI.
- Refactored tests with new ExUnit parameterize feature.
:pool_id
is not required init option anymore. For now it is equal toworker_module
option value.
- Functions
Poolex.add_idle_workers!/2
andPoolex.remove_idle_workers!/2
now accept any value of typeGenServer.name()
as their first argument, instead of onlyatom()
. - Supressed Supervisor's error logs in tests.
1.1.0 - 2024-12-08
- Added adobe/elixir-styler to project.
- Monitoring implementation has been optimized by using a plain map instead of the
Agent
process. - Refactored
State
struct by adding a list of@enforced_keys
. (Details) - Poolex processes now have higher priority. (Details)
Poolex.get_state/1
deprecated in favor of:sys.get_state/1
.
1.0.0 - 2024-09-23
- Monitoring implementation now uses
Agent
instead of:ets
. It's needed to be more flexible in pool naming. - The
pool_id
can now be any validGenServer.name()
. For example,{:global, :biba}
or{:via, Registry, {MyRegistry, "boba"}}
.
0.10.0 - 2024-08-26
- Added functions
add_idle_workers!/2
andremove_idle_workers!/2
for changing count of idle workers in runtime.
- Refactored private
start_workers
function. It no longer accepts monitor_id as it already is in the state. - Updated
telemetry
dependency.
0.9.0 - 2024-04-24
- Added sending of pools size metrics via
telemetry
. Working with metrics guide
0.8.0 - 2023-08-30
-
Option
:timeout
renamed to:checkout_timeout
.-
Reason: This option configures only the waiting time for
worker
from the pool, not the task's work time. This naming should be more understandable on the call site.# Before Poolex.run(:my_awesome_pool, fn worker -> some_work(worker) end, timeout: 10_000) # After Poolex.run(:my_awesome_pool, fn worker -> some_work(worker) end, checkout_timeout: 10_000)
-
-
Poolex.run/3
returns tuple{:error, :checkout_timeout}
instead of:all_workers_are_busy
.- Reason: It is easier to understand the uniform format of the response from the function:
{:ok, result}
or{:error, reason}
.
- Reason: It is easier to understand the uniform format of the response from the function:
-
Poolex.caller()
type replaced with struct defined inPoolex.Caller.t()
.- Reason: We need to save unique caller references.
-
Poolex.run!/3
was removed in favor ofPoolex.run/3
. The new unified function returns{:ok, result}
or{:error, :checkout_timeout}
and not handles runtime errors anymore.- Reason: We should not catch errors in the caller process. The caller process itself must choose how to handle exceptions and exit signals.
- Fixed a bug when workers get stuck in
busy
status after checkout timeout.
0.7.6 - 2023-08-03
- Fixed a bug with workers stuck in busy status. Added caller monitoring. PR
0.7.5 - 2023-07-31
- Fixed a serious bug when working with the
idle_workers
set. Previous version retired.
0.7.4 - 2023-07-23 (RETIRED)
- Fixed a bug where a restarted worker was not automatically dispatched to pending callers (Issue / PR).
- Upgraded ex_doc from
0.29.4
to0.30.3
0.7.3 - 2023-06-21
- Fixed a bug with an incorrect number of running workers when specifying a zero or negative number in the
workers_count
parameter (PR).
0.7.2 - 2023-06-11
- Trap exit to shutdown correctly (PR) .
- Implementation settings are stored in the pool process state instead of the ETS table. This makes the testing process easier and removes unnecessary entities.
0.7.1 - 2023-06-03
- Fixed the shutdown process: stop workers before the pool (issue).
0.7.0 - 2023-04-13
- Added
FIFO
worker's implementation (About implemetations).
0.6.1 - 2023-03-25
- Refactored some custom types and added some typedocs.
- Added
diff
syntax highlighting support. - Updated guides:
- The pages were merged into a group called
Guides
. - Tried to refresh some pages with cheatmd.
- The pages were merged into a group called
0.6.0 - 2023-03-09
- [INCOMPATIBLE] Changed approach to configuring custom implementations for queues of workers and callers.
-
Reasons: Avoid application configuration
-
Now for the configuration you need to use the initialization parameters instead of
Application
config.# Before import Config config :poolex, callers_impl: SomeCallersImpl, busy_workers_impl: SomeBusyWorkersImpl, idle_workers_impl: SomeIdleWorkersImpl # After Poolex.child_spec( pool_id: :some_pool, worker_module: SomeWorker, workers_count: 10, waiting_callers_impl: SomeCallersImpl, busy_workers_impl: SomeBusyWorkersImpl, idle_workers_impl: SomeIdleWorkersImpl )
-
0.5.1 - 2023-03-04
- [Docs] Simple migration guide from
:poolboy
- [Docs] Fix missing
Poolex.State.t()
on docs generating (issue)
0.5.0 - 2023-02-24
- The default value of the parameter
:worker_start_fun
changed from:start
to:start_link
, since the second value is used more often. - [INCOMPATIBLE] Reworked pool launch functions
start
andstart_link
-
First argument
pool_id
moved topoolex_options
under required key:pool_id
. So the arity of both functions has changed to1
.# Before Poolex.start(:my_pool, worker_module: Agent, workers_count: 5) # After Poolex.start(pool_id: :my_pool, worker_module: Agent, workers_count: 5)
-
child_spec/1
was redefined to support:pool_id
key inpoolex_options
. Now the pool can be added to the supervisor tree in a more convenient way.children = [ Poolex.child_spec(pool_id: :worker_pool_1, worker_module: SomeWorker, workers_count: 5), # or in another way {Poolex, [pool_id: :worker_pool_2, worker_module: SomeOtherWorker, workers_count: 5]} ] Supervisor.start_link(children, strategy: :one_for_one)
-
0.4.0 - 2023-02-18
- Overflow feature. Example of use
- Speeding up CI by adding dialyzer PLT files caches.
- Fix links in hex documentation.
- Added missing spec for
get_debug_info/1
.
0.3.0 - 2023-02-03 (RETIRED)
- The ability to set your own implementations for
workers
andcallers
. Read more about it - New interface
Poolex.debug_info/1
.
- All documentation is divided into separate guides. A table of contents with links has been added to the Readme.
- Several changes have been made to the
Poolex.State
structure:- Fields
busy_workers_count
andbusy_workers_pids
removed in favor ofbusy_workers_state
. - Fields
idle_workers_count
andidle_workers_pids
removed in favor ofidle_workers_state
. - Field
waiting_callers
changed towaiting_callers_state
.
- Fields
0.2.2 - 2023-01-28
- Docs for functions with examples of use.
- Use ex_check for static analysis.
0.2.1 - 2023-01-27
- Updated minimum required versions
- Elixir:
1.7
- OTP:
22
- Elixir:
0.2.0 - 2023-01-25
run/3
was moved torun!/3
since it can raise runtime errors.run/3
function now handles errors and returns:{:ok, any()}
on success;:all_workers_are_busy
when no idle worker is found in the pool;{:runtime_error, any()}
on runtime errors.
- Now workers are running under DynamicSupervisor for better control.
- Fix bug on worker release logic.
0.1.1 - 2023-01-06
- Fix
Poolex.run/3
spec.
0.1.0 - 2023-01-06
- Supported main interface
Poolex.run/3
with:timeout
option.