benjamintanweihao / the-little-elixir-otp-guidebook-code

Code examples for The Little Elixir & OTP Guidebook
372 stars 71 forks source link

Pooly version 3 update #14

Closed Cinderella-Man closed 5 years ago

Cinderella-Man commented 7 years ago

Hello,

I'm new to Elixir and OTP, I believe that Pooly version 3 contains 2 issues - I can be wrong.

First one is kind of obvious when you checkout a worker for the pool and kill it. Fix here

Second one is more subtle. When above got fixed I relised that now I'm getting 2 new workers from single killed one. Reason of that is that WorkerSupervisor will restart dead worker as well as PoolServer (as long as it was checkouted). There's no simple solution to the problem without going too far away from book content so I most obvious solution would be to keep WorkerSupervisor's restart to :temporary - Fix is here

Please let me know what do you think :) Hope that above makes sense

Thanks,

Kamil

benjamintanweihao commented 5 years ago

A little late, but thank you! <3