We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I try something like (simplified)
def start_link(name) do Horde.DynamicSupervisor.start_link(__MODULE__, [], name: name) end def via(name), do: {:via, Horde.Registry, {MyApp.DistributedRegistry, name}}
and trying to start it with
Horde.DynamicSupervisor.start_child(MyApp.DistributedSupervisor, {__MODULE__, name})
getting the error
{:error, {%Protocol.UndefinedError{ description: "", protocol: String.Chars, value: {:via, Horde.Registry, {Distributed.DistributedRegistry, "hello"}} }, [ {String.Chars, :impl_for!, 1, [file: 'lib/string/chars.ex', line: 3]}, {String.Chars, :to_string, 1, [file: 'lib/string/chars.ex', line: 22]}, {Horde.DynamicSupervisor, :start_link, 3, [file: 'lib/horde/dynamic_supervisor.ex', line: 131]}, {Horde.ProcessesSupervisor, :start_child, 3, [file: 'lib/horde/processes_supervisor.ex', line: 766]}, {Horde.ProcessesSupervisor, :handle_start_child, 2, [file: 'lib/horde/processes_supervisor.ex', line: 752]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 661]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 690]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]} ]}}
When tried to start with a simple string name (by mistake), I got the following error, which made me think the :via option should be possible
:via
{:error, {:shutdown, {:failed_to_start_child, Horde.DynamicSupervisorImpl, {:EXIT, {%ArgumentError{ message: "expected :name option to be one of the following:\n\n * nil\n * atom\n * {:global, term}\n * {:via, module, term}\n\nGot: \"hello\"\n" }, [ {GenServer, :do_start, 4, [file: 'lib/gen_server.ex', line: 943]}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 379]}, {:supervisor, :do_start_child, 2, [file: 'supervisor.erl', line: 365]}, {:supervisor, :"-start_children/2-fun-0-", 3, [file: 'supervisor.erl', line: 349]}, {:supervisor, :children_map, 4, [file: 'supervisor.erl', line: 1157]}, {:supervisor, :init_children, 2, [file: 'supervisor.erl', line: 315]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]} ]}}}}}
The text was updated successfully, but these errors were encountered:
I've also run into this problem. It seems to be because of https://github.com/derekkraan/horde/blob/master/lib/horde/dynamic_supervisor.ex#L131 which assumes that name is a binary.
name
Sorry, something went wrong.
Hey, thanks for the issue. If someone wants to submit a PR that makes Horde work with via tuple semantics then I would be happy to merge that.
No branches or pull requests
I try something like (simplified)
and trying to start it with
getting the error
When tried to start with a simple string name (by mistake), I got the following error, which made me think the
:via
option should be possibleThe text was updated successfully, but these errors were encountered: