I’m trying to wrap my head around the flow of messages from the client to a channel, standing in my way is the correlation between the socket, transport and channel pieces.
Please correct me on the below if I’m wrong.
Initial connection setup
- Request from client via communication library is handled by the
Transport process
on server. Transport process
delegates/forward socket and other data to theSocket
moduleSocket
module invokesconnect
/id
function to authenticate and do assignment where applicableSocket
module communicates back to theTransport process
Incoming message (phx_join or a diff msg)
- Can I assume this will be routed directly from the
Transport process
to theChannel
module, will theTransport process
introspect theSocket
module, use thechannel macro
to forward the request to the appropriateChannel
or it’s has this information already viasocket
struct returned bySocket
module in the initial connection setup phase? - If the above is wrong; will the
Transport process
delegate to theSocket
module which will then call then call theChannel
module
Thank you.