~/talk

Building a Realtime Websocket API in Phoenix

Talkat NDC Oslo 2023 · 2023-05-22..05-26· [elixir-and-erlang, web-platform]
links:none on file
slides:none on file

Built a realtime WebSocket API with Phoenix and Elixir where the server is the authoritative timer and each user gets an OTP process as the timer, tracked and rehydrated on restart, using a GraphQL connect mutation that returns a token and WS URL, custom JSON messages shaped as [model, action] with timestamped tick events every second, tests verifying the OTP timer state and throughput with Blaze, removed Phoenix channel internals to simplify clients, heartbeat and reconnect logic handle intermittent drops and the cross‑device sync works.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Talk overview
  3. 3:54Websockets for Pomodoro
  4. 6:08What is websocket
  5. 10:26Websockets vs HTTP
  6. 11:28Phoenix and Elixir
  7. 13:13OTP and hot code reload
  8. 14:20Realtime API inspiration
  9. 15:03GraphQL API setup
  10. 20:51Phoenix websocket OTP
  11. 21:34Phoenix channels
  12. 25:26Custom websocket API
  13. 26:08Message structure
  14. 27:13Timer start events
  15. 30:01Broadcasting events
  16. 32:53Implementation flow
  17. 33:59Q&A Elixir ecosystem
  18. 36:32Q&A language servers
  19. 36:53Q&A resilience
  20. 38:38Q&A message ordering
  21. 39:53Q&A client support
  22. 40:55Q&A message frequency
  23. 42:25Q&A reconnecting heartbeats
  24. 44:08Q&A timing precision
  25. 44:52Q&A multi-server sync
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.