elixir-lang / gen_stage

Producer and consumer actors with back-pressure for Elixir
http://hexdocs.pm/gen_stage
1.52k stars 192 forks source link

Change default child :restart to :transient in ConsumerSupervisor #231

Closed silviurosu closed 5 years ago

silviurosu commented 5 years ago

I have setup a new CunsumerSupervisor similar to the one from documentation. I received error when starting the app that a child specification with restart: :permanent is not supported and I had to manually set it to :transient. Then why the default value is :permanent here? I had to look in the code to figure out how to make it work. It would been better to not set it to :permanent or update the documentation to specify what values are accepted.

josevalim commented 5 years ago

Hi @silviurosu, the reason why we default to permanent is because the regular supervisor defaiults to permanent and we don't want to suddenly change the restart type under your feet without telling you. So you need to explicitly opt in. A PR that improves the docs would be deeply appreciated. Thanks!