Packages

Generic Timer that broadcasts :tick to subscribers

Current section

Files

Jump to
vt_gen_timer lib gen_timer pub_sub.ex
Raw

lib/gen_timer/pub_sub.ex

defmodule GenTimer.PubSub do
def subscribe(topic) do
Phoenix.PubSub.subscribe(__MODULE__, topic)
end
def broadcast(topic, message) do
Phoenix.PubSub.broadcast(__MODULE__, topic, message)
end
def unsubscribe(topic) do
Phoenix.PubSub.unsubscribe(__MODULE__, topic)
end
end