@nxtedition/lib 28.0.31 → 28.0.33

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/app.d.ts CHANGED
@@ -10,7 +10,7 @@ export function makeApp<
10
10
  Records extends Record<string, unknown> = Record<string, unknown>,
11
11
  RpcMethods extends Record<string, RpcMethodDef> = Record<string, RpcMethodDef>,
12
12
  Config = Record<string, unknown>,
13
- >(appConfig: AppConfig<Config>, meta?: { url: string }): App<Records, RpcMethods, Config>
13
+ >(appConfig: AppConfig<Config>, meta?: { url: URL | string }): App<Records, RpcMethods, Config>
14
14
 
15
15
  export interface AppConfig<Config = Record<string, unknown>> {
16
16
  name?: string
package/app.js CHANGED
@@ -593,7 +593,7 @@ export function makeApp(appConfig, onTerminateOrMeta, metaOrNull) {
593
593
  .subscribe((numa) => {
594
594
  if (numa != null) {
595
595
  try {
596
- const affinity = numa.setAffinity(numa)
596
+ const affinity = setAffinity(numa)
597
597
  logger.debug({ hostname: config.hostname, numa, affinity }, 'net numa succeeded')
598
598
  } catch (err) {
599
599
  logger.error({ err, hostname: config.hostname, numa }, 'net numa failed')
package/couch.d.ts CHANGED
@@ -19,6 +19,7 @@ export interface CouchRequestOptions<Stream extends boolean = false> {
19
19
  headersTimeout?: number
20
20
  bodyTimeout?: number
21
21
  dispatcher?: Dispatcher
22
+ priority?: 0|1|2|"low"|"normal"|"high"
22
23
  query?: {
23
24
  key?: string
24
25
  startkey?: string
package/fixed-queue.js CHANGED
@@ -84,9 +84,11 @@ class FixedCircularBuffer {
84
84
  }
85
85
  }
86
86
 
87
+ const POOL = []
88
+
87
89
  export class FixedQueue {
88
90
  constructor() {
89
- this.head = this.tail = new FixedCircularBuffer()
91
+ this.head = this.tail = POOL.pop() ?? new FixedCircularBuffer()
90
92
  this.size = 0
91
93
  }
92
94
 
@@ -98,7 +100,7 @@ export class FixedQueue {
98
100
  if (this.head.isFull()) {
99
101
  // Head is full: Creates a new queue, sets the old queue's `.next` to it,
100
102
  // and sets it as the new main queue.
101
- this.head = this.head.next = new FixedCircularBuffer()
103
+ this.head = this.head.next = POOL.pop() ?? new FixedCircularBuffer()
102
104
  }
103
105
  this.head.push(data)
104
106
  }
@@ -109,6 +111,12 @@ export class FixedQueue {
109
111
  if (tail.isEmpty() && tail.next !== null) {
110
112
  // If there is another queue, it forms the new tail.
111
113
  this.tail = tail.next
114
+ tail.next = null
115
+ tail.bottom = 0
116
+ tail.top = 0
117
+ if (POOL.length < 64) {
118
+ POOL.push(tail)
119
+ }
112
120
  }
113
121
  return next
114
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "28.0.31",
3
+ "version": "28.0.33",
4
4
  "license": "UNLICENSED",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -93,5 +93,5 @@
93
93
  "canvas": "^3.1.0",
94
94
  "rxjs": "^7.0.0"
95
95
  },
96
- "gitHead": "b764a06e9dc3fcdce6d4e136086dc378e0acc772"
96
+ "gitHead": "5e9be5511fdd2e10aecbab7cc007bdaf990f728a"
97
97
  }