Musubi.Transport.ConnectionChannel (musubi v0.12.0)

Copy Markdown View Source

Phoenix Channel adapter for one Musubi root store.

Each root store gets its own channel on topic "musubi:connection:<root_id>". Join is the mount: join/3 runs the socket module's Musubi.Socket.handle_join/2, composes the root_id from the join params, and starts exactly one root page server bound to this channel. Leaving the channel (client leave() or a transport drop) stops that root via terminate/2.

Phoenix owns reconnect: on a dropped socket it automatically re-joins each channel, which re-runs join/3 and rebuilds the root — the client drives the rest from the per-channel join reply. There is no separate "mount" / "unmount" message and no multiplexing of multiple roots over one channel.

Telemetry

  • [:musubi, :channel, :join]%{system_time: integer}. Metadata: module, id, topic, page_pid. module is the Musubi socket module, id is the composed root_id, and page_pid is the started root page server.
  • [:musubi, :channel, :terminate]%{system_time: integer}. Metadata: module, id, topic, reason, page_pid, root_count. root_count is 1 when a root was mounted on this channel, else 0.

Summary

Functions

child_spec(init_arg)

start_link(triplet)