@deephaven-enterprise/client-utils 2026.1.67 → 2026.1.69

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.
@@ -1,6 +1,28 @@
1
1
  import type { EnterpriseDhType, WorkerKind } from '@deephaven-enterprise/jsapi-types';
2
2
  import type { dh as DhType } from '@deephaven/jsapi-types';
3
3
  import type { AuthenticatedEnterpriseClient } from './types';
4
+ /**
5
+ * State of the connection to a query's designated Core+ worker.
6
+ * - `idle`: the query isn't running on a Core+ worker, so there's no connection
7
+ * - `connecting`: connecting to the query's current worker for the first time
8
+ * - `connected`: connected. A new state object is emitted each time the
9
+ * connection comes back, as objects fetched before it was lost don't survive
10
+ * - `disconnected`: the connection was lost and the JS API is reconnecting
11
+ * it, or an attempt to connect failed and is retried on the query's next
12
+ * config update
13
+ */
14
+ export type CorePlusConnectionState = {
15
+ status: 'idle';
16
+ } | {
17
+ status: 'connecting';
18
+ } | {
19
+ status: 'connected';
20
+ api: typeof DhType;
21
+ connection: DhType.IdeConnection;
22
+ } | {
23
+ status: 'disconnected';
24
+ };
25
+ export type CorePlusConnectionListener = (state: CorePlusConnectionState) => void;
4
26
  /**
5
27
  * Interface defining a connection manager for fetching APIs from and creating
6
28
  * connections to CorePlus workers, and managing the lifecycle of the underlying
@@ -38,6 +60,24 @@ export interface CorePlusManager {
38
60
  * @return The IDE connection for the specified worker kind
39
61
  */
40
62
  getConnection(dh: typeof DhType, grpcUrl: string, envoyPrefix?: string | null): Promise<DhType.IdeConnection>;
63
+ /**
64
+ * Subscribe to the state of the connection to a query's designated worker.
65
+ * While subscribed, the connection follows the query to new workers, is
66
+ * replaced if its auth fails, and a failed attempt to connect is retried on
67
+ * the query's next config update. The listener is
68
+ * not called with the current state; use `getConnectionState` for that.
69
+ * @param querySerial The serial of the query
70
+ * @param listener Called each time the state changes
71
+ * @returns A function to unsubscribe
72
+ */
73
+ subscribeToConnection(querySerial: string, listener: CorePlusConnectionListener): () => void;
74
+ /**
75
+ * Get the current state of the connection to a query's designated worker.
76
+ * Returns the same object until the state changes. The state is only kept
77
+ * up to date while there are subscribers; otherwise it is `idle`.
78
+ * @param querySerial The serial of the query
79
+ */
80
+ getConnectionState(querySerial: string): CorePlusConnectionState;
41
81
  /**
42
82
  * Get the worker kind or null for the specified engine.
43
83
  * @param engine The engine to get the worker kind for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven-enterprise/client-utils",
3
- "version": "2026.1.67",
3
+ "version": "2026.1.69",
4
4
  "description": "Deephaven Enterprise Client Connectivity Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@deephaven/jsapi-types": "1.0.0-dev0.40.5",
26
- "@deephaven-enterprise/jsapi-types": "2026.1.67",
26
+ "@deephaven-enterprise/jsapi-types": "2026.1.69",
27
27
  "@deephaven/log": "^1.32.0",
28
- "@deephaven/utils": "^1.34.0"
28
+ "@deephaven/utils": "^1.35.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"