Documentation
¶
Overview ¶
Package mq containts helper functions to make the work with RabbitMQ easier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Consume ¶
func Consume(ch *amqp091.Channel, name string, handle chan<- event.InternalEvent)
Consume consumes events from the queue with the specified name. It will wait forever for new events until the program shuts down. After consuming, the event will be forwarded to the handle channel.
Panics if the queue cannot be consumed.
func DeclareTopology ¶
DeclareTopology declares the hub topic exchange and two queues: gate and core. After declaring the queues, they are bound to the exchange, which serves as the event bus for all events in the system.
The gate queue is consumed by the core server, and the gatekeeper will publish incomming client events to it. The core queue is consumed by the gatekeeper, and the core server will publish server events to it.
Do not call this function from the core server, since it's a gatekeeper's responsibility to manage the lifecycle of queues and the exchange.
Types ¶
This section is empty.