@milaboratories/pl-client 2.4.19 → 2.4.21

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": "@milaboratories/pl-client",
3
- "version": "2.4.19",
3
+ "version": "2.4.21",
4
4
  "description": "New TS/JS client for Platform API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -34,14 +34,14 @@
34
34
  "devDependencies": {
35
35
  "typescript": "~5.5.4",
36
36
  "vite": "^5.4.8",
37
- "@types/node": "~20.16.5",
37
+ "@types/node": "~20.16.10",
38
38
  "@protobuf-ts/plugin": "^2.9.4",
39
39
  "@types/http-proxy": "^1.17.15",
40
40
  "@types/jest": "^29.5.13",
41
41
  "jest": "^29.7.0",
42
42
  "@jest/globals": "^29.7.0",
43
43
  "ts-jest": "^29.2.5",
44
- "@milaboratories/platforma-build-configs": "1.0.1"
44
+ "@milaboratories/platforma-build-configs": "1.0.2"
45
45
  },
46
46
  "scripts": {
47
47
  "type-check": "tsc --noEmit --composite false",
@@ -284,8 +284,8 @@ export class PlClient {
284
284
  }
285
285
 
286
286
  /** Closes underlying transport */
287
- public close() {
288
- this.ll.close();
287
+ public async close() {
288
+ await this.ll.close();
289
289
  }
290
290
 
291
291
  public static async init(
@@ -66,8 +66,8 @@ export interface PlClientConfig {
66
66
  retryJitter: number;
67
67
  }
68
68
 
69
- export const DEFAULT_REQUEST_TIMEOUT = 1000;
70
- export const DEFAULT_TX_TIMEOUT = 10_000;
69
+ export const DEFAULT_REQUEST_TIMEOUT = 2000;
70
+ export const DEFAULT_TX_TIMEOUT = 30_000;
71
71
  export const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;
72
72
  export const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;
73
73
 
@@ -76,7 +76,14 @@ export class LLPlClient {
76
76
  }
77
77
 
78
78
  grpcInterceptors.push(this.createErrorInterceptor());
79
-
79
+
80
+ //
81
+ // Leaving it here for now
82
+ // https://github.com/grpc/grpc-node/issues/2788
83
+ //
84
+ // We should implement message pooling algorithm to overcome hardcoded NO_DELAY behaviour
85
+ // of HTTP/2 and allow our small messages to batch together.
86
+ //
80
87
  const grpcOptions: GrpcOptions = {
81
88
  host: this.conf.hostAndPort,
82
89
  timeout: this.conf.defaultRequestTimeout,
@@ -84,7 +91,7 @@ export class LLPlClient {
84
91
  ? ChannelCredentials.createSsl()
85
92
  : ChannelCredentials.createInsecure(),
86
93
  clientOptions: {
87
- 'grpc.use_local_subchannel_pool': 1,
94
+ 'grpc.keepalive_time_ms': 3000,
88
95
  interceptors: grpcInterceptors
89
96
  }
90
97
  };
@@ -238,7 +245,8 @@ export class LLPlClient {
238
245
  }
239
246
 
240
247
  /** Closes underlying transport */
241
- public close() {
248
+ public async close() {
242
249
  this.grpcTransport.close();
250
+ await this.httpDispatcher.destroy();
243
251
  }
244
252
  }