 
   @doc """
 
-  Writes on each connections the matched document.
+  Writes on each transports the matched document.
   """
-  def handle_cast({:notify, id, body}, state) do
-    Enum.each(state.connections, fn(conn) -> write(message(id, item), conn) end)
-    connections = Enum.reduce(state.connections, [], fn(conn, connections) -> write(connections, conn, response, id) end)
-    {:noreply, Map.update!(state, :connections, fn(_) -> connections end) }
+  def handle_cast({:notify, id, item}, state) do
+    Enum.each(state.transports, fn(transport) -> write(transport, message(id, item)) end)
+    {:noreply, state }
   end
 
   @doc """
 
-  Add a connection to the connections's pool.
+  Add a transport to the transports's pool.
   """
-  def handle_call({:add, conn, last_id}, _from, state) do
-    conn = write_from_cache(conn, state.cache, last_id)
-    {:reply, conn, Map.update!(state, :connections, fn(_) -> [conn | state.connections] end) }
+  def handle_call({:add, transport, last_id}, _from, state) do
+    transport = write_from_cache(transport, state.cache, last_id)
+    {:reply, transport, Map.update!(state, :transports, fn(_) -> [transport | state.transports] end) }
   end
 
   defp name(token) do

defmodule Funnel.Transistor do
  @moduledoc """
  `Funnel.Transistor` can be see as a User. It can have several connections, and
  will notify a matching document on each of thoses connections.
  """
  use GenServer.Behaviour
  alias Funnel.Transistor.Cache

  import Funnel.Transport, only: [write: 2]

  defmodule Funnel.TransistorState do
    defstruct cache: nil, transports: []
  end

  alias Funnel.TransistorState
