@nxtedition/rocksdb 7.0.52 → 7.0.53

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/index.js CHANGED
@@ -16,6 +16,7 @@ const kContext = Symbol('context')
16
16
  const kColumns = Symbol('columns')
17
17
  const kLocation = Symbol('location')
18
18
  const kPromise = Symbol('promise')
19
+ const kUpdates = Symbol('updates')
19
20
 
20
21
  const EMPTY = {}
21
22
 
@@ -342,6 +343,7 @@ class RocksLevel extends AbstractLevel {
342
343
  }
343
344
 
344
345
  options.signal?.addEventListener('abort', onAbort)
346
+ this.on('closing', onAbort)
345
347
 
346
348
  try {
347
349
  let since = options.since
@@ -379,7 +381,7 @@ class RocksLevel extends AbstractLevel {
379
381
 
380
382
  try {
381
383
  if (since <= this.sequence) {
382
- for await (const update of this._updates(options)) {
384
+ for await (const update of this[kUpdates](options)) {
383
385
  if (ac.signal.aborted) {
384
386
  throw new AbortError()
385
387
  }
@@ -406,11 +408,12 @@ class RocksLevel extends AbstractLevel {
406
408
  }
407
409
  }
408
410
  } finally {
411
+ this.off('closing', onAbort)
409
412
  options.signal?.removeEventListener('abort', onAbort)
410
413
  }
411
414
  }
412
415
 
413
- async * _updates (options) {
416
+ async * [kUpdates] (options) {
414
417
  class Updates {
415
418
  constructor (db, options) {
416
419
  this.context = binding.updates_init(db[kContext], options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.0.52",
3
+ "version": "7.0.53",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
Binary file