Skip to content

Commit

Permalink
Fix documentation (DocTest) for Phoenix.PubSub (#119)
Browse files Browse the repository at this point in the history
Use `Process.info(self(), :messages)` instead of `Process.info(self())[:messages]`.
The later one was returning an empty array for me every time.
  • Loading branch information
Štefan Ľupták authored and michalmuskala committed Nov 7, 2018
1 parent 3f324a5 commit 50c1da2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/phoenix/pubsub.ex
Expand Up @@ -49,12 +49,12 @@ defmodule Phoenix.PubSub do
iex> PubSub.subscribe :my_pubsub, "user:123"
:ok
iex> Process.info(self())[:messages]
[]
iex> Process.info(self(), :messages)
{:messages, []}
iex> PubSub.broadcast :my_pubsub, "user:123", {:user_update, %{id: 123, name: "Shane"}}
:ok
iex> Process.info(self())[:messages]
{:user_update, %{id: 123, name: "Shane"}}
iex> Process.info(self(), :messages)
{:messages, [{:user_update, %{id: 123, name: "Shane"}}]}
## Implementing your own adapter
Expand Down

0 comments on commit 50c1da2

Please sign in to comment.