Skip to content

Instantly share code, notes, and snippets.

@vishnevskiy
Created July 6, 2017 08:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishnevskiy/72a474caede46752a9a824318fffcdd1 to your computer and use it in GitHub Desktop.
Save vishnevskiy/72a474caede46752a9a824318fffcdd1 to your computer and use it in GitHub Desktop.
def handle_call({:publish, message}, _from, %{sessions: sessions}=state) do
Enum.each(sessions, &send(&1.pid, message))
{:reply, :ok, state}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment