arjan / singleton

Global, supervised singleton processes for Elixir
MIT License
108 stars 19 forks source link

Possible change in manager process #7

Open sonic182 opened 3 years ago

sonic182 commented 3 years ago

It is possible that this line

https://github.com/arjan/singleton/blob/ae3d0dd970954626beb90fddf8c83b6840cb6920/lib/singleton/manager.ex#L18

is the one that make managers process not to be restarted, when normal shutdown of process used in singleton?

when scaling down one service, my single process gets down and doesn't get up in remaining nodes of service... I think is because it gets detected as normal shutdown instead of abruptly

https://hexdocs.pm/elixir/Supervisor.html#module-restart-values-restart

If so, would be nice to pass the restart value by config, when starting the singleton

arjan commented 3 years ago

Yes indeed, transient causes the process only to be restarted if it exited abnormally. PR welcome to change this :-)