PhoenixKitBoards.Web.BoardChannel (PhoenixKitBoards v0.4.0)

Copy Markdown View Source

Relays a board's ephemeral traffic between the people looking at it.

Two kinds, both worthless a moment after they arrive:

  • "cursor" — where someone's pointer is, in canvas coordinates, so each viewer maps it through their own pan and zoom.
  • "moving" — where a shape is while it is still being dragged. Peers patch it into place and see the drag happen; the edit itself is stored and broadcast the usual way when the gesture ends.

Deliberately does nothing else. No database, no diff, no persistence, and no state beyond who is on the topic — the point of moving this off the LiveView was to stop this traffic queueing behind that work.

The sender is excluded from everything it sends (broadcast_from): it drew its own cursor and moved its own shape locally, and echoing would fight the gesture in progress.

Nothing arriving here is trusted as identity. The peer is whatever the signed join token said, so a client can move its own cursor and nobody else's.

Summary

Functions

child_spec(init_arg)

start_link(triplet)