gausby / tortoise

A MQTT Client written in Elixir
Apache License 2.0
313 stars 54 forks source link

unknown registery: Tortoise.Regsitry #144

Open TKTheTechie opened 2 years ago

TKTheTechie commented 2 years ago

Hi All,

I'm trying to run a sample program using the following code:

 {ok, _pid} =
  Tortoise.Connection.start_link(
    client_id: HelloWorld,
    server: {Tortoise.Transport.Tcp, host: "localhost", port: 1883},
    handler: {Tortoise.Handler.Logger, []}
  )

It returns an error:

== Compilation error in file lib/elixir_solace.ex ==
** (ArgumentError) unknown registry: Tortoise.Registry
    (elixir 1.12.3) lib/registry.ex:1341: Registry.key_info!/1
    (elixir 1.12.3) lib/registry.ex:227: Registry.whereis_name/2
    (stdlib 3.16.1) gen.erl:84: :gen.start/6
    lib/elixir_solace.ex:5: (module)

How do I resolve this?

sleipnir commented 2 years ago

Use Tortoise.Supervisor.start_child instead Tortoise.Connection.start_link