dashbitco / nimble_pool

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

add optional init_pool/1 callback #3

Closed sneako closed 4 years ago

sneako commented 4 years ago

While using NimblePool, I had the need to register my pools in a Registry.

My first attempt led me to call Registry.register/3 in the NimblePool.init/1 callback, but this is actually for the workers and not the pool itself.

This pr adds an optional init_pool/1 callback to the NimblePool behaviour where one is now able to perform a registration if needed, or customize the pool state itself.

josevalim commented 4 years ago

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