   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)

  alias Phoenix.Socket.Message

  @moduledoc """
  """

  defmodule InvalidReturn do

    |> handle_result("info")
  end

  @doc """
  Whenever a remote client disconnects, the adapter must forward the event through
  this function to be dispatched as `"leave"` events on each socket channel.

  Most adapters shutdown after this dispatch as they client has disconnected
  """
  def dispatch_leave(socket, reason) do
    Enum.each socket.channels, fn {channel, topic} ->
      socket
