I'm using Golang to write a game server. I was wondering what the advantages of queuing the incoming packets for processing over processing them immediately.
For example (processing immediately) each new connection/client a new goroutine/coroutine is created and within that goroutine a loop that reads from the network socket and has a switch statement that routes and handles each packet.
Or (queuing) each new connection/client a new goroutine is created and within that goroutine a loop that reads from the network socket and passes it to a queue. A second dedicated goroutine for this clientconnection/client has a loop that process the packets in the queue.
Is this a pre-optimization? How are MMORPG's (server side) packet recv/handling handled in principle?
I'm using TCP.