Real-Time Phoenix: only the first 3 responses are displayed on the console (p.101)

Here is a scenario of cyclic sending messages and receiving responses via slowStatsChannel.
The transport accepts all 5 responses, but only the first 3 responses that meet the 10s interval are displayed on the console, as seen in DevTools.
My understanding is that a packet transaction has a lifetime, after which the packets are accepted but are not passed to the processing script. This is a tricky disconcerting point for those who are new to real-time network programming.

Just to clarify, do you mean this lifetime is implemented in Phoenix JS lib, or somewhere else?

The packets transmitted over the channel’s WebSocket are not delayed at all. It’s the request/response lifecycle that’s delayed inside of the Channel’s logic (via Process.sleep). So, when a message is sent, it’s going to be sent as fast as possible from client → server and server → client.

WebSocket itself does not have the concept of request/response lifecycle, so that’s all implemented by Phoenix’s libraries.