Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change sockets to channels in Transport.dispatch #1231

Merged
merged 1 commit into from
Sep 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/phoenix/socket/transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ defmodule Phoenix.Socket.Transport do
must be sent as result

"""
def dispatch(msg, sockets, socket)
def dispatch(msg, channels, socket)

def dispatch(%{ref: ref, topic: "phoenix", event: "heartbeat"}, _sockets, _socket) do
def dispatch(%{ref: ref, topic: "phoenix", event: "heartbeat"}, _channels, _socket) do
{:reply, %Reply{ref: ref, topic: "phoenix", status: :ok, payload: %{}}}
end

def dispatch(%Message{} = msg, sockets, socket) do
sockets
def dispatch(%Message{} = msg, channels, socket) do
channels
|> HashDict.get(msg.topic)
|> do_dispatch(msg, socket)
end
Expand Down Expand Up @@ -231,8 +231,8 @@ defmodule Phoenix.Socket.Transport do
reply_ignore(msg, socket)
end

defp do_dispatch(socket_pid, msg, _socket) do
send(socket_pid, msg)
defp do_dispatch(channel_pid, msg, _socket) do
send(channel_pid, msg)
:noreply
end

Expand Down