hackney icon indicating copy to clipboard operation
hackney copied to clipboard

hackney_pool:find_pool/2 adds new child to supervisor

Open edgurgel opened this issue 10 years ago • 2 comments

Is it intentional that find_pool/2 starts a new child if the pool does not exist?

I'm asking this cause I thought that the "correct" ways would be to include the child to the user's supervisor or to call start_pool before using it.

edgurgel avatar Oct 04 '15 05:10 edgurgel

Good catch...

Coming version (it's a matter of hours) of the pool doesn't start the pool if it is not existing. Though the new function start_pool/2 start it in the new hackney_pool_sup supervisor. I guess i could add a pool_spec/2 function that create a specification to add to your own supervisor. Would that work for you?

benoitc avatar Oct 04 '15 12:10 benoitc

Yes! That would work! :+1:

edgurgel avatar Oct 04 '15 20:10 edgurgel