I am trying to start multiple poolboy workers in my application like this:
def start(_type, _args) do
children = [
# Start the Ecto repository
MyApp.Repo,
# Start the Telemetry supervisor
MyAppWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: MyApp.PubSub},
# Start the Endpoint (http/https)
MyAppWeb.Endpoint,
# Start a worker by calling: MyApp.Worker.start_link(arg)
# {MyApp.Worker, arg}
:poolboy.child_spec(:generator, generator_poolboy_config()),
:poolboy.child_spec(:summarizer, summarizer_poolboy_config()),
:poolboy.child_spec(:analyzer, analyzer_poolboy_config())
]
But I get this error:
** (Mix) Could not start application my_app: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: :summarizer
** (EXIT) already started: #PID<0.600.0>
But if I comment out the other poolboy workers and leave only one everything runs. My question is how can I start multiple poolboy workers? Since it is an Erlang library I could not find any docs. Thank you!!