gcf-common-lib 0.23.26 → 0.23.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils.js +3 -3
- package/src/utils.ts +1 -1
package/package.json
CHANGED
package/src/utils.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.sendToQueueAsync = exports.withAmqpCh = exports.withAmqpConn = exports.A1ToColNum = exports.colNumToA1 = exports.A1ToIndex = exports.indexToA1 = exports.delay = exports.timeoutAfter = void 0;
|
|
16
16
|
const amqplib_1 = require("amqplib");
|
|
17
17
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
18
18
|
/**
|
|
@@ -104,7 +104,7 @@ function withAmqpCh(fn, url) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
exports.withAmqpCh = withAmqpCh;
|
|
107
|
-
function
|
|
107
|
+
function sendToQueueAsync(ch, queue, json, options) {
|
|
108
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
109
|
const payload = Buffer.from(JSON.stringify(json));
|
|
110
110
|
const keepSending = ch.sendToQueue(queue, payload, options);
|
|
@@ -112,4 +112,4 @@ function sentToQueueAsync(ch, queue, json, options) {
|
|
|
112
112
|
yield new Promise(resolve => ch.once('drain', () => resolve));
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
exports.
|
|
115
|
+
exports.sendToQueueAsync = sendToQueueAsync;
|
package/src/utils.ts
CHANGED
|
@@ -92,7 +92,7 @@ export async function withAmqpCh(fn: (ch: Channel) => Promise<any>, url: string)
|
|
|
92
92
|
}, url);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export async function
|
|
95
|
+
export async function sendToQueueAsync(ch: Channel, queue: string, json: Dictionary<any>, options: Options.Publish) {
|
|
96
96
|
const payload = Buffer.from(JSON.stringify(json));
|
|
97
97
|
const keepSending = ch.sendToQueue(queue, payload, options);
|
|
98
98
|
if (!keepSending) await new Promise(resolve => ch.once('drain', () => resolve));
|