@quatrain/queue-amqp 1.3.2 → 1.3.3

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.
@@ -1,11 +1,21 @@
1
1
  import { AbstractQueueAdapter } from '@quatrain/queue';
2
2
  import amqplib, { ChannelModel } from 'amqplib';
3
+ /**
4
+ * AMQP Protocol compatible adapter (RabbitMQ, etc.) using `amqplib`.
5
+ */
3
6
  export declare class AmqpQueueAdapter extends AbstractQueueAdapter {
4
7
  protected _client: ChannelModel | undefined;
5
8
  protected _logger: any;
6
9
  constructor(params: any);
7
10
  protected _connect(): Promise<ChannelModel>;
8
11
  protected _disconnect(): Promise<void>;
12
+ /**
13
+ * Enqueues data using the active amqplib channel.
14
+ *
15
+ * @param data - Raw payload.
16
+ * @param topic - Specific queue name.
17
+ * @returns Result string identifier.
18
+ */
9
19
  send(data: any, topic: string): Promise<string>;
10
20
  /**
11
21
  * Listen to given queue and process messages with messageHandler function
@@ -15,6 +15,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.AmqpQueueAdapter = void 0;
16
16
  const queue_1 = require("@quatrain/queue");
17
17
  const amqplib_1 = __importDefault(require("amqplib"));
18
+ /**
19
+ * AMQP Protocol compatible adapter (RabbitMQ, etc.) using `amqplib`.
20
+ */
18
21
  class AmqpQueueAdapter extends queue_1.AbstractQueueAdapter {
19
22
  constructor(params) {
20
23
  super(params);
@@ -35,6 +38,13 @@ class AmqpQueueAdapter extends queue_1.AbstractQueueAdapter {
35
38
  yield ((_a = this._client) === null || _a === void 0 ? void 0 : _a.close());
36
39
  });
37
40
  }
41
+ /**
42
+ * Enqueues data using the active amqplib channel.
43
+ *
44
+ * @param data - Raw payload.
45
+ * @param topic - Specific queue name.
46
+ * @returns Result string identifier.
47
+ */
38
48
  send(data, topic) {
39
49
  return __awaiter(this, void 0, void 0, function* () {
40
50
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/queue-amqp",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Queue adapter for AMQP compatible queue",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@cloudamqp/amqp-client": "^3.4.1",
38
- "@quatrain/core": "^1.2.5",
39
- "@quatrain/queue": "^1.2.2",
38
+ "@quatrain/core": "^1.2.6",
39
+ "@quatrain/queue": "^1.2.3",
40
40
  "amqplib": "^0.10.9"
41
41
  },
42
42
  "scripts": {
@@ -1,6 +1,9 @@
1
1
  import { AbstractQueueAdapter, Queue } from '@quatrain/queue'
2
2
  import amqplib, { ChannelModel, ConsumeMessage, Message } from 'amqplib'
3
3
 
4
+ /**
5
+ * AMQP Protocol compatible adapter (RabbitMQ, etc.) using `amqplib`.
6
+ */
4
7
  export class AmqpQueueAdapter extends AbstractQueueAdapter {
5
8
  declare protected _client: ChannelModel | undefined
6
9
  protected _logger: any
@@ -31,6 +34,13 @@ export class AmqpQueueAdapter extends AbstractQueueAdapter {
31
34
  await this._client?.close()
32
35
  }
33
36
 
37
+ /**
38
+ * Enqueues data using the active amqplib channel.
39
+ *
40
+ * @param data - Raw payload.
41
+ * @param topic - Specific queue name.
42
+ * @returns Result string identifier.
43
+ */
34
44
  async send(data: any, topic: string): Promise<string> {
35
45
  await this._connect()
36
46