     """
   end
 
+  @doc """
+  Arbitrary Elixir processes are received by adapters and forwarded through
+  this function to be dispatched as `"info"` events on each socket channel.
+
+  The returned `%Socket{}`'s state must be held by the adapter
+  """
   def dispatch_info(socket = %Socket{},  data) do
     socket = Enum.reduce socket.channels, socket, fn {channel, topic}, socket ->
       {:ok, socket} = dispatch_info(socket, channel, topic, data)

  alias Phoenix.Socket.Message

  @moduledoc """
  """

  defmodule InvalidReturn do

  end


  @doc """
  Dispatches `%Message{}` to Channel. All serialized, remote client messages
  should be deserialied and fowarded through this function by adapters.

  The following return signatures must be handled by transport adapters:
    * `{:ok, socket}` - Successful dispatch, with updated state
    * `{:error, socket, reason}` - Failed dispatched with updatd state

  The returned `%Socket{}`'s state must be held by the adapter
  """
  def dispatch(msg, socket) do
    socket
    |> Socket.set_current_channel(msg.channel, msg.topic)
