geonix 1.8.0 → 1.8.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonix",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "bin": {
package/src/Connection.js CHANGED
@@ -110,7 +110,7 @@ class Connection {
110
110
  }
111
111
 
112
112
  async subscribe(subject, options) {
113
- return await this.#nc.subscribe(subject, options)
113
+ return this.#nc.subscribe(subject, options)
114
114
  }
115
115
 
116
116
  async unsubscribe(subscription) {
package/src/Stream.js CHANGED
@@ -28,15 +28,12 @@ export function Stream(data) {
28
28
  readable = transform
29
29
 
30
30
  const controlHandler = async () => {
31
- const control = await connection.subscribe(`gx2.stream.${id}.a`)
31
+ const control = await connection.subscribe(`gx2.stream.${id}.a`, { max: 1 })
32
32
 
33
33
  for await (const event of control)
34
34
  if (event.data.length === 0) {
35
35
  readable.on('data', chunk => connection.publishRaw(`gx2.stream.${id}.b`, chunk))
36
- readable.on('close', () => {
37
- connection.publishRaw(`gx2.stream.${id}.b`)
38
- control.drain()
39
- })
36
+ readable.on('close', () => connection.publishRaw(`gx2.stream.${id}.b`))
40
37
  }
41
38
  }
42
39