Cauldron3D.Net.Channel (Cauldron3D.Net v0.3.3)

Copy Markdown View Source

The Phoenix channel a browser joins to watch a Cauldron3D.Net.Scene.

defmodule MyGame.Web.SceneChannel do
  use Cauldron3D.Net.Channel
end

The topic is "scene:<id>" (:topic names another prefix), id a scene started with Cauldron3D.Net.Scene.start_link/1. On joining, the browser is pushed the whole scene as one binary "changes" message, then each batch the scene broadcasts; its "event" messages reach the scene's :events pid (Cauldron3D.Net.Events), with :joined when it arrives and :left when it goes.