but how would I catch the down message of process exist? what would be the equivalent of GenServer: def handle_info({:DOWN, _, :process, _pid, reason}, state) in a channel module?
FYI, if you Task.start_link a process inside of a channel and that task crashes, it’s going to kill the channel because you’re linking the task to the channel.
Why not use a monitor instead? Also as I already pointed out… Phoenix.Channel has a callback handle_info/2…
And yes Supervisor would create a new channel (if suervised) but its starts from a fresh state, so it’ll probably loose all connected users as well. If thats a problem in your use case is up to you…