Skip to content

Commit 8b92e8f

Browse files
authored
Minor fixes to specs and bench scripts (#193)
1 parent 2dcf0a1 commit 8b92e8f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/phoenix/pubsub.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ defmodule Phoenix.PubSub do
226226
A custom dispatcher may also be given as a fifth, optional argument.
227227
See the "Custom dispatching" section in the module documentation.
228228
"""
229-
@spec direct_broadcast(t, topic, message, dispatcher) :: :ok | {:error, term}
229+
@spec direct_broadcast(node_name, t, topic, message, dispatcher) :: :ok | {:error, term}
230230
def direct_broadcast(node_name, pubsub, topic, message, dispatcher \\ __MODULE__)
231231
when is_atom(pubsub) and is_binary(topic) and is_atom(dispatcher) do
232232
{:ok, {adapter, name}} = Registry.meta(pubsub, :pubsub)

lib/phoenix/tracker/state.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule Phoenix.Tracker.State do
4747
4848
## Examples
4949
50-
iex> Phoenix.Tracker.State.new(:replica1)
50+
iex> Phoenix.Tracker.State.new(:replica1, :shard_name)
5151
%Phoenix.Tracker.State{...}
5252
5353
"""

script/bench.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ defmodule Bench do
1818
topic_size = trunc(size / 10)
1919

2020
{s1, s2} = time "Creating 2 #{size} element sets", fn ->
21-
s1 = Enum.reduce(1..size, State.new(:s1), fn i, acc ->
21+
s1 = Enum.reduce(1..size, State.new(node(), :s1), fn i, acc ->
2222

2323
State.join(acc, make_ref(), "topic#{:erlang.phash2(i, topic_size)}", "user#{i}", %{name: i})
2424
end)
2525

26-
s2 = Enum.reduce(1..size, State.new(:s2), fn i, acc ->
26+
s2 = Enum.reduce(1..size, State.new(node(), :s2), fn i, acc ->
2727
State.join(acc, make_ref(), "topic#{i}", "user#{i}", %{name: i})
2828
end)
2929

@@ -100,4 +100,4 @@ defmodule Bench do
100100
end
101101
end
102102

103-
Bench.run(System.argv())
103+
Bench.run(System.argv())

0 commit comments

Comments
 (0)