Teamlinker/code/server/common/mq/mq.ts
sx1989827 efe535180b init
2023-04-24 20:00:49 +08:00

12 lines
303 B
TypeScript

import * as amqpLib from "amqplib"
export class BaseMq {
private static conn:amqpLib.Connection
static async initChannel (uri) {
BaseMq.conn=await amqpLib.connect(uri)
}
async createChannel() {
let channel=await BaseMq.conn.createChannel()
return channel
}
}