-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Killing parent process? #14
Comments
@jclement have you tried putting Singleton.Supervisor as the last children? |
@jclement have you managed to solve this? we're facing the same issue |
Hello @jclement and @Abdallahj94, I think the reason could be that Application.start callback expects the return value to be In the example above the Singleton defmodule Pento.Application do
use Application
@impl true
def start(_type, _args) do
children = [
PentoWeb.Telemetry,
Pento.Repo,
{DNSCluster, query: Application.get_env(:pento, :dns_cluster_query) || :ignore},
{Phoenix.PubSub, name: Pento.PubSub},
# Start the Finch HTTP client for sending emails
{Finch, name: Pento.Finch},
{Singleton.Supervisor, name: Pento.Singleton},
# Start to serve requests, typically the last entry
PentoWeb.Endpoint,
]
opts = [strategy: :one_for_one, name: Pento.Supervisor]
app_supervisor = Supervisor.start_link(children, opts)
Singleton.start_child(Pento.Singleton, Pento.Guesses.CounterServer, [], Pento.Guesses.CounterServer)
app_supervisor
end
...
end |
Hi there,
This library seems like what I'm looking for, but I'm seeing similar behaviour to what is described in the announcement post on Elixir Forums >> https://elixirforum.com/t/singleton-global-supervised-singleton-processes-for-elixir/2175/3
I have a Phoenix application running across multiple nodes, and I want this Singleton process to run on a single node and be used by all nodes. However, I see that the only node that says running is the one running the Singleton process.
The text was updated successfully, but these errors were encountered: