Consumers
So as of right now, we have the following setup:
- A publisher publishes a message
- The message arrives in an exchange
- The message is routed to queue(s)
- ???
- Profit
In all seriousness, nothing happens after the message arrives in the queue!
This is where consumers come in. Consumers are programs (like our "client" program) that connect to queues and pull the messages out of them.

Assignment
Let's configure our client consumers to process the "pause messages" and update their local game state.
export async function subscribeJSON<T>(
conn: amqp.ChannelModel,
exchange: string,
queueName: string,
key: string,
queueType: SimpleQueueType, // an enum to represent "durable" or "transient"
handler: (data: T) => void,
): Promise<void>;
-
-
-
function handlerPause(gs: GameState): (ps: PlayingState) => void;
-
-
-
Run and submit the CLI tests with the server and client still running.