You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
I ended up further inlining the via: registry lookup:
Registry.lookup(Tortoise.Registry, {Tortoise.Connection, connection_id})
|> case do
[{pid, nil}] -> GenServer.call(pid, :disconnect)
_ -> connection_id |> IO.inspect(label: "CONNECTION NOT PRESENT")
end
This seems kind of roundabout, but it works. I think disconnect() should never fail. So I'll always use this instead of the current disconnect/1 API.
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:
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.
The text was updated successfully, but these errors were encountered: