MCPcopy Create free account
hub / github.com/CFBD/cfb-api / createQueue

Function createQueue

config/consumers.js:4–20  ·  view source on GitHub ↗
(exchangeName, action)

Source from the content-addressed store, hash-verified

2 const rabbit = await require('./rabbit')();
3 const channel = rabbit.channel;
4 const createQueue = async (exchangeName, action) => {
5 channel.assertExchange(exchangeName, 'fanout');
6
7 const q = await channel.assertQueue('', {
8 exclusive: true
9 });
10
11 channel.bindQueue(q.queue, exchangeName, '');
12
13 channel.consume(q.queue, (message) => {
14 if (message.content) {
15 action(JSON.parse(message.content.toString()));
16 }
17 }, {
18 noAck: true
19 });
20 };
21
22 return {
23 createQueue

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected