@zizq-labs/zizq 0.4.1 → 0.4.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/dist/client.d.ts +14 -0
- package/dist/client.js +13 -1
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -111,6 +111,20 @@ export interface ClientOptions {
|
|
|
111
111
|
* Default: 30000 (30s).
|
|
112
112
|
*/
|
|
113
113
|
streamIdleTimeout?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Maximum number of concurrent HTTP/2 streams per connection that
|
|
116
|
+
* undici will request from the server via the
|
|
117
|
+
* `SETTINGS_MAX_CONCURRENT_STREAMS` frame. The effective ceiling
|
|
118
|
+
* is the minimum of this value and what the server advertises in
|
|
119
|
+
* its own SETTINGS — so raising this client-side only helps if
|
|
120
|
+
* the server is also configured to allow more streams.
|
|
121
|
+
*
|
|
122
|
+
* Applies to the request/response pool only. The long-lived
|
|
123
|
+
* `take()` stream uses HTTP/1.1 and is unaffected.
|
|
124
|
+
*
|
|
125
|
+
* Default: 1024.
|
|
126
|
+
*/
|
|
127
|
+
maxConcurrentStreams?: number;
|
|
114
128
|
/** @internal For testing — override the HTTP dispatcher. */
|
|
115
129
|
dispatcher?: Dispatcher;
|
|
116
130
|
}
|
package/dist/client.js
CHANGED
|
@@ -168,12 +168,24 @@ export class Client {
|
|
|
168
168
|
} : {}),
|
|
169
169
|
timeout: connectTimeout,
|
|
170
170
|
};
|
|
171
|
-
// HTTP/2 for request/response traffic (multiplexed acks,
|
|
171
|
+
// HTTP/2 for request/response traffic (multiplexed acks,
|
|
172
|
+
// enqueues, queries). `useH2c: true` lets undici speak HTTP/2
|
|
173
|
+
// over cleartext via prior knowledge, so http:// URLs get h2
|
|
174
|
+
// multiplexing too — not just https://. The Zizq server's hyper
|
|
175
|
+
// stack already accepts h2 prior-knowledge on any connection
|
|
176
|
+
// via its auto-protocol detector.
|
|
177
|
+
//
|
|
172
178
|
// `bodyTimeout` is per-chunk inactivity — reset on each byte —
|
|
173
179
|
// so it acts as the read timeout; `headersTimeout` caps
|
|
174
180
|
// "server accepted the request but didn't respond" cases.
|
|
175
181
|
this.http = new Pool(this.url, {
|
|
176
182
|
allowH2: true,
|
|
183
|
+
// `useH2c` is supported at runtime in undici >=8 but isn't
|
|
184
|
+
// present in the public type definitions yet. Remove the
|
|
185
|
+
// expect-error once undici ships the type.
|
|
186
|
+
// @ts-expect-error -- runtime-supported, untyped
|
|
187
|
+
useH2c: true,
|
|
188
|
+
maxConcurrentStreams: options.maxConcurrentStreams ?? 1024,
|
|
177
189
|
connect: connectOpts,
|
|
178
190
|
headersTimeout: readTimeout,
|
|
179
191
|
bodyTimeout: readTimeout,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zizq-labs/zizq",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Node.js client for the Zizq job queue server",
|
|
5
5
|
"homepage": "https://zizq.io",
|
|
6
6
|
"repository": {
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^25.5.2",
|
|
49
|
-
"typescript": "^
|
|
49
|
+
"typescript": "^6.0.3"
|
|
50
50
|
}
|
|
51
51
|
}
|