Server Manager application
Finally, we can start writing the largest application so far. The Server Manager is going to be a CLI application that will be responsible for spawning WebSocket servers, where each server is a standalone application itself, with its own clients and chat history.
A typical use-case could be a Unix server that manages multiple instances of some game server. Each server needs to be isolated. If any of them crashed, we don't want all games servers on this machine to crash as well. At the same time, we want to be able to collect some status information from servers and monitor them in real time with the Server Manager.
We can describe the structure of this entire application and what role the Server Manager has with the following diagram:
In this diagram, we can see the Server Manager application on the right. It communicates via Unix sockets with a single instance of Game Server. This instance of Game Server has two clients connected to it via WebSockets.
Communication...