Closed bjuretic closed 1 month ago
Thank you for reporting the issue.
I have removed the restriction on starting as a distributed node, as it was no longer necessary. Additionally, I have added the ability to start child processes statically.
Example:
child_specs = for x <- 1..10 do
%{
id: :"my_process_#{x}",
start: {MyProcess, :start_link, []}
}
end
ProcessHub.child_spec(%ProcessHub{
hub_id: :my_hub,
child_specs: child_specs
})
I also realized that I forgot to publish the 0.2.6-alpha release.. The master branch was up to date, but the code was not published to Hex. The new version, 0.2.7-alpha, is now published.
Thanks! Static processes starting is working fine and there are no more issues with starting mix commands.
(moving this into a separate issue for easier tracking)
Ok, I have tried this and it works, but there is something I would consider a bug if it is done this way. Consider the code in Application.start:
This runs fine if the node is started as part of a cluster. But if I want to run a simple mix command, e.g.
mix ecto.reset
it fails:Starting the app with iex with cookie and node name works fine.
From what I gather, it just expects the application to be ran in a cluster, and if fails when it cannot find node info. Error message could be better, but the main point is what would you recommend here on how to start the processes on Application.start while still being able to execute mix commands and tests (which also fail to run with the same error)?
(update) Actually even just starting the ProcessHub in Application.start with no child processes being started later by it causes the similar problem. Again running
mix ecto.reset
or running tests end with: