mix do deps.get, compile
iex -S mix
#=> #PID<0.184.0> The pub/sub listener is subscribed to: "my-channel"
:sys.get_state(PubSub.Connection)
#=> {:connected,
#=> %Redix.PubSub.Connection{
#=> ...
#=> pending_subscriptions: %{},
#=> subscriptions: %{{:channel, "my-channel"} => #MapSet<[#PID<0.184.0>]>},
#=> }
#=> }
#=> }
send(PubSub.MyChannel, :die)
#=> [error] GenServer PubSub.MyChannel terminating
#=> #PID<0.194.0> The pub/sub listener is subscribed to: "my-channel"
Supervisor started new process instead of crashed one. It should subscribe to "my-channel" in init callback (you can see the log message).
:sys.get_state(PubSub.Connection)
#=> {:connected,
#=> %Redix.PubSub.Connection{
#=> ...
#=> pending_subscriptions: %{{:channel, "my-channel"} => #MapSet<[#PID<0.194.0>]>},
#=> subscriptions: %{},
#=> }
#=> }
#=> }
As you can see newly started #PID<0.194.0> remains in :pending_subscriptions
, and does not receive messages from channel any more.