Releases: general-CbIC/poolex
[1.3.0] Handle errors on a worker's start
What's Changed
Added
-
Added caching of the dependencies on CI (compilation speed up).
-
Added a new option
failed_workers_retry_interval
to the pool configuration. This option configures the millisecond interval between retry attempts for workers that failed to start. The value is1 second
by default. Example:Poolex.start_link( worker_module: SomeUnstableWorker, workers_count: 5, failed_workers_retry_interval: 3_000 )
Changed
- Due to the deprecation of support for Ubuntu 20.04 on GitHub Actions (read more here), bumped minimum required versions of Elixir to
~> 1.11
and Erlang/OTP to~> 24
.
Fixed
- Fixed the
MatchError
on pool starting error that occurs with errors on the launch of workers (read more in issue).
Full Changelog: v1.2.1...v1.3.0
[1.2.1] Patch with some fixes
What's Changed
Fixed
- Now the
busy_worker
will be restarted after thecaller's
death. Read more in issue. - The function
add_idle_workers!/2
now provides new workers to waiting callers if they exist. Read more in issue.
Full Changelog: v1.2.0...v1.2.1
[1.2.0] `pool_id` fallbacks to `worker_module`
What's Changed
Added
- Added Elixir 1.18.* support to CI.
Changed
- Refactored tests with new ExUnit parameterize feature.
:pool_id
is not required init option anymore. For now it is equal toworker_module
option value.
Fixed
- 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.
Full Changelog: v1.1.0...v1.2.0
[1.1.0] Optimized monitoring and other improvements
What's Changed
Added
- Added adobe/elixir-styler to project.
Changed
- 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)
Deprecated
Poolex.get_state/1
deprecated in favor of:sys.get_state/1
.
New Contributors
Full Changelog: v1.0.0...v1.1.0
[1.0.0] Support any `GenServer.name()` as `pool_id`
What's changed
Changed
- 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] Change pool size in runtime
What's changed
Added
- Added functions
add_idle_workers!/2
andremove_idle_workers!/2
for changing the count of idle workers in runtime.
Changed
- Refactored private
start_workers
function. It no longer accepts monitor_id as it already is in the state. - Updated
telemetry
dependency.
[0.9.0] Pool size metrics
What's Changed
Pool size metrics (using telemetry
) were added. How to use them is described here: Working with metrics guide.
To enable pool size metrics, you need to set the pool_size_metrics
parameter to true
on the pool initialization:
children = [
{Poolex,
pool_id: :worker_pool,
worker_module: SomeWorker,
workers_count: 5,
pool_size_metrics: true}
]
[0.8.0] Merge `run` interfaces
What's Changed
Breaking changes
-
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
- Fixed a bug when workers get stuck in
busy
status after checkout timeout.