Skip to content

Safest way to disconnect redundantly?  #139

@travisgriggs

Description

@travisgriggs

A second/redundant call to Tortoise.Connection.disconnect/1 creates all kinds of heartache. I tried to inline the two lines of code that make up this API:

  connection_pid = Tortoise.Connection.via_name(connection_id) |> IO.inspect(label: "CONNECTION_PID")
  GenServer.call(connection_pid, :disconnect) |> IO.inspect(label: ":DISCONNECT call")

What I found is that the registry seems to still know about the connection/pid pairing after the disconnect (maybe it eventually goes away?)

But I can't figure how to safely issue a disconnect. The call blows up. And in a way that I can't even seem to get a rescuing hander around it. I can't even figure out how to put together a query that would determine if the client_id is registered or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions