dashbitco / nimble_pool

A tiny resource-pool implementation for Elixir
347 stars 20 forks source link

add worker_idle_timeout as get_metadata parameter #25

Closed oliveigah closed 2 years ago

oliveigah commented 2 years ago

With this modification, calls to System.monotonic_time/1 will only be made when :worker_idle_timeout is provided by the user.

As discussed on https://github.com/sneako/finch/issues/159 the main worry about the idle timeout implementation was the unnecessary calls to System.monotonic_time/1 on a very high load scenario.

To make this feature completely transparent to users who do not want to use it, I've added worker_idle_timeout as a parameter to the previous get_metadata/0, this way if it is not provided no calls are made to System.monotonic_time/1.

josevalim commented 2 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

oliveigah commented 2 years ago

Thanks for the fast merge @josevalim! Do you know what still need to be done before releasing a new version of nimble pool with this feature? Can I help with something?

josevalim commented 2 years ago

v0.2.5 is out!