Open iasoon opened 6 years ago
To elaborate on this for a bit with an example on why this is cool: suppose we are running a small cluster of mozaic game servers. To simplify this construction, we run one additional server that serves as an entry point (similar to how you'd use nginx as a reverse proxy for running web applications), and routes all messages to the server that is actually handling the game. We route clients based on (clientid, matchuuid). Gameservers could emit an event when they create or end a game, and these events could then be shared with this 'entry server', which could then update its routing table with new (gameserver, matchuuid) pairs to perform its function.
With different kinds of routing messages, we could extend this mechanism from gameservers to anything that communicates over MOZAIC connections.
Currently we are sending messages to a router to identify a connection, and updating the router state with callbacks. This sounds suspiciously like the event-driven parts of our code. Maybe we should introduce this abstraction!
In a far future, event-souring router state might also be really cool to automatically proxy connections etc.