api specs

This commit is contained in:
2026-04-29 00:45:48 +04:00
parent 27143319e3
commit 8cda54548f
67 changed files with 5052 additions and 93 deletions

View File

@@ -0,0 +1,15 @@
defmodule ShootingEventPhx.Events do
@moduledoc false
@topic "state_updates"
def topic, do: @topic
def subscribe do
Phoenix.PubSub.subscribe(ShootingEventPhx.PubSub, @topic)
end
def broadcast do
payload = {:state, DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}
Phoenix.PubSub.broadcast(ShootingEventPhx.PubSub, @topic, payload)
end
end