The Client struct was only necessary when we were using websockets as it was full duplex and we received commands and sent responses. Now that we are using SSE and most of the low level details are hidden we don't need to have our own concurrent read / write loops.
It also made more sense earlier in the history of the project when each browser connection would get its own IRC connection as a Client encapsulated a single browser request / response / IRC loop. Now that we are using a single IRC connection, we can just put this state on the server struct.
The
Client
struct was only necessary when we were using websockets as it was full duplex and we received commands and sent responses. Now that we are using SSE and most of the low level details are hidden we don't need to have our own concurrent read / write loops.It also made more sense earlier in the history of the project when each browser connection would get its own IRC connection as a Client encapsulated a single browser request / response / IRC loop. Now that we are using a single IRC connection, we can just put this state on the
server
struct.