Event queue

In some cases it is necessary to schedule jobs for later processing or to schedule jobs or communicate with other server side systems. For that we have the event queue. At the foundation we have BullMQ. You should read up on it, if you intend on using this system.

Queues

The first part are the queues. These are currently statically defined in libs\core\event\server\queues.ts this is to insure that all instances that use the queue have the same definition. Queues define the input and output using Zod. The QueueService validates the input when a job is created and the output when a worker completes the job. All defined queues are loaded during first retrieval of the QueueService. You can get all available by queues / the queue service by using:

You then can add jobs to the queue using addJob or register a worker using registerWorker. Outside of the zod validation and automatic creation of queues everything behaves like regular BullMQ.