           new_queue = :queue.in_r({:subscribe, other_channels, receiver}, new_queue)
         end
 
+        message = {:redix_pubsub, :subscribe, channel}
+        send(receiver, message)
+
         %{s | queue: new_queue}
       _ ->
         raise "oops"


  def handle_cast({:pubsub_punsubscribe, channels, receiver}, s) do
    s
    |> enqueue({:unsubscribe, channels, receiver})
    |> send_noreply(Protocol.pack(["PUNSUBSCRIBE"|channels]))
  end


  end

  defp new_pubsub_msg(s, ["message", channel, message]) do
    message = {:redix_pubsub, :message, channel, message}
    deliver_message(s.pubsub_clients[channel], message)
    s
  end

  defp new_pubsub_msg(s, ["pmessage", pattern, channel, message]) do
    message = {:redix_pubsub, :pmessage, {pattern, channel}, message}
    deliver_message(s.pubsub_clients[pattern], message)
    s
  end

