-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
https://github.com/arjan/singleton/blob/master/lib/singleton/manager.ex#L58
defp restart(state) do
start_result =
GenServer.start_link(state.mod, state.args, name: {:global, state.name})
pid =
case start_result do
{:ok, pid} ->
pid
{:error, {:already_started, pid}} ->
state.on_conflict && state.on_conflict.()
pid
end
Process.monitor(pid)
%State{state | pid: pid}
endIt would be nice if GenServer.start_link/3 here could be replaced by state.mod.start_link/3. That would allow for starting a process which depends on custom code within the start_link/3 function.
Metadata
Metadata
Assignees
Labels
No labels