comq 0.11.1 → 0.11.2

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/lerna.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.11.1",
2
+ "version": "0.11.2",
3
3
  "conventionalCommits": true
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comq",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "ComQ",
5
5
  "author": {
6
6
  "name": "Artem Gurtovoi",
package/source/channel.js CHANGED
@@ -58,6 +58,8 @@ class Channel {
58
58
  if (this.#topology.confirms) this.#channel = await this.#connection.createConfirmChannel()
59
59
  else this.#channel = await this.#connection.createChannel()
60
60
 
61
+ await this.#channel.prefetch(this.#topology.prefetch)
62
+
61
63
  this.#channel.on('drain', this.#unpause)
62
64
  this.#channel.on('return', (message) => this.#diagnostics.emit('return', message))
63
65
  }
@@ -42,6 +42,13 @@ it('should return Channel', async () => {
42
42
  expect(channel).toBeDefined()
43
43
  })
44
44
 
45
+ it('should set prefetch limit', async () => {
46
+ channel = await create(connection, topology)
47
+ chan = await getCreatedChannel()
48
+
49
+ expect(chan.prefetch).toHaveBeenCalledWith(topology.prefetch)
50
+ })
51
+
45
52
  it.each([true, false])('should create channel (confirms: %s)', async (confirms) => {
46
53
  const method = `create${confirms ? 'Confirm' : ''}Channel`
47
54