Skip to content

Commit 4f0b4ba

Browse files
committed
mix format
1 parent 148ae10 commit 4f0b4ba

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

lib/phoenix/pubsub.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ defmodule Phoenix.PubSub do
162162
163163
The default dispatcher will broadcast the message to all subscribers except for the
164164
process that initiated the broadcast.
165-
165+
166166
A custom dispatcher may also be given as a fifth, optional argument.
167167
See the "Custom dispatching" section in the module documentation.
168168
"""
@@ -202,7 +202,7 @@ defmodule Phoenix.PubSub do
202202
203203
The default dispatcher will broadcast the message to all subscribers except for the
204204
process that initiated the broadcast.
205-
205+
206206
A custom dispatcher may also be given as a fifth, optional argument.
207207
See the "Custom dispatching" section in the module documentation.
208208
"""

lib/phoenix/tracker.ex

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ defmodule Phoenix.Tracker do
9797
require Logger
9898
alias Phoenix.Tracker.Shard
9999

100-
@type presence :: {key :: String.t, meta :: map}
101-
@type topic :: String.t
100+
@type presence :: {key :: String.t(), meta :: map}
101+
@type topic :: String.t()
102102

103-
@callback init(Keyword.t) :: {:ok, state :: term} | {:error, reason :: term}
104-
@callback handle_diff(%{topic => {joins :: [presence], leaves :: [presence]}}, state :: term) :: {:ok, state :: term}
103+
@callback init(Keyword.t()) :: {:ok, state :: term} | {:error, reason :: term}
104+
@callback handle_diff(%{topic => {joins :: [presence], leaves :: [presence]}}, state :: term) ::
105+
{:ok, state :: term}
105106
@callback handle_info(message :: term, state :: term) :: {:noreply, state :: term}
106107
@optional_callbacks handle_info: 2
107108

@@ -207,8 +208,10 @@ defmodule Phoenix.Tracker do
207208
iex> Phoenix.Tracker.update(MyTracker, self(), "lobby", u.id, fn meta -> Map.put(meta, :away, true) end)
208209
{:ok, "1WpAofWYIAA="}
209210
"""
210-
@spec update(atom, pid, topic, term, map | (map -> map)) :: {:ok, ref :: binary} | {:error, reason :: term}
211-
def update(tracker_name, pid, topic, key, meta) when is_pid(pid) and (is_map(meta) or is_function(meta)) do
211+
@spec update(atom, pid, topic, term, map | (map -> map)) ::
212+
{:ok, ref :: binary} | {:error, reason :: term}
213+
def update(tracker_name, pid, topic, key, meta)
214+
when is_pid(pid) and (is_map(meta) or is_function(meta)) do
212215
tracker_name
213216
|> Shard.name_for_topic(topic, pool_size(tracker_name))
214217
|> GenServer.call({:update, pid, topic, key, meta})
@@ -332,16 +335,18 @@ defmodule Phoenix.Tracker do
332335
}
333336
end
334337

335-
children = if permdown_on_shutdown do
336-
shards ++ [
337-
%{
338-
id: :shutdown_handler,
339-
start: {Phoenix.Tracker.ShutdownHandler, :start_link, [tracker]}
340-
}
341-
]
342-
else
343-
shards
344-
end
338+
children =
339+
if permdown_on_shutdown do
340+
shards ++
341+
[
342+
%{
343+
id: :shutdown_handler,
344+
start: {Phoenix.Tracker.ShutdownHandler, :start_link, [tracker]}
345+
}
346+
]
347+
else
348+
shards
349+
end
345350

346351
opts = [
347352
strategy: :one_for_one,

0 commit comments

Comments
 (0)