Skip to content
hyperpolymath edited this page Aug 8, 2026 · 1 revision

API Internals

This page details the internal APIs and messaging protocols used within the Burble Elixir application.

GenServer Messages

Rooms in Burble are backed by a central Burble.Room GenServer. Clients interact with the room via asynchronous casts and synchronous calls.

Joining a Room

  • Call: {:join, client_pid, client_metadata}
  • Reply: {:ok, room_state}
  • Effect: The client_pid is registered. The room broadcasts a {:user_joined, client_metadata} to all other participants.

Media Routing

Media routing is heavily optimized. RTP packets are received by a dedicated UDP listener process, which bypasses the room's central GenServer for performance. It looks up the routing table via ETS (Erlang Term Storage) and forwards the packet directly to the destination client processes.

Bebop Codecs

The signalling wire format is defined in server/priv/schemas/voice_signal.bop. The Elixir application uses a pre-compiled Bebop parser to decode incoming binary WebSocket frames into Elixir structs.

If a Bebop decode fails, the system automatically falls back to attempting a JSON parse, ensuring backward compatibility with older clients or alternative implementations.

Clone this wiki locally