Closed surrsurus closed 12 months ago
It looks like the assigns are being discarded because the call to connect/1
is creating a fresh socket. I think you should be able to switch from connect/1
- which calls new_socket
if not provided with an existing socket - with connect/2
and the assigns should carry through
Ahhhhh that explains it, my bad didn't fully see how connect
was working, thanks!
Hi, I've been using slipstream for a little bit and it's been great. I ran into one issue that I think might be a bug but I'm not sure. I have the following code in a slipstream-powered genserver:
I assign the
partner
on init, and it's just an atom, the idea is I'm spinning up multiple of these servers for eachpartner
. If I inspect the socket assigns before and after, I notice that the assigns get cleared after the call tojoin/3
, because myhandle_join/2
blows up as it expects apartner
in the assigns.IO.inspect
ing the socket reveals the assigns are there beforejoin/3
and then is an empty map afterwards. I can easily fix this issue by just assigning thepartner
again after the join, but it felt like something was up. If this is intentional behavior feel free to disregard.