bunqueue 1.9.1 → 1.9.3
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/application/operations/queueControl.d.ts.map +1 -1
- package/dist/application/operations/queueControl.js +6 -1
- package/dist/application/operations/queueControl.js.map +1 -1
- package/dist/application/queueManager.d.ts +115 -9
- package/dist/application/queueManager.d.ts.map +1 -1
- package/dist/application/queueManager.js +535 -26
- package/dist/application/queueManager.js.map +1 -1
- package/dist/cli/client.d.ts +6 -0
- package/dist/cli/client.d.ts.map +1 -1
- package/dist/cli/client.js +60 -48
- package/dist/cli/client.js.map +1 -1
- package/dist/cli/commands/server.d.ts.map +1 -1
- package/dist/cli/commands/server.js +30 -14
- package/dist/cli/commands/server.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +10 -6
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +15 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/client/queue/dlqOps.d.ts +24 -0
- package/dist/client/queue/dlqOps.d.ts.map +1 -0
- package/dist/client/queue/dlqOps.js +73 -0
- package/dist/client/queue/dlqOps.js.map +1 -0
- package/dist/client/queue/helpers.d.ts +20 -0
- package/dist/client/queue/helpers.d.ts.map +1 -0
- package/dist/client/queue/helpers.js +34 -0
- package/dist/client/queue/helpers.js.map +1 -0
- package/dist/client/queue/index.d.ts +8 -0
- package/dist/client/queue/index.d.ts.map +1 -0
- package/dist/client/queue/index.js +8 -0
- package/dist/client/queue/index.js.map +1 -0
- package/dist/client/queue/queue.d.ts +60 -0
- package/dist/client/queue/queue.d.ts.map +1 -0
- package/dist/client/queue/queue.js +322 -0
- package/dist/client/queue/queue.js.map +1 -0
- package/dist/client/queue.d.ts +3 -78
- package/dist/client/queue.d.ts.map +1 -1
- package/dist/client/queue.js +3 -463
- package/dist/client/queue.js.map +1 -1
- package/dist/client/sandboxed/index.d.ts +8 -0
- package/dist/client/sandboxed/index.d.ts.map +1 -0
- package/dist/client/sandboxed/index.js +7 -0
- package/dist/client/sandboxed/index.js.map +1 -0
- package/dist/client/sandboxed/types.d.ts +62 -0
- package/dist/client/sandboxed/types.d.ts.map +1 -0
- package/dist/client/sandboxed/types.js +6 -0
- package/dist/client/sandboxed/types.js.map +1 -0
- package/dist/client/sandboxed/worker.d.ts +38 -0
- package/dist/client/sandboxed/worker.d.ts.map +1 -0
- package/dist/client/sandboxed/worker.js +176 -0
- package/dist/client/sandboxed/worker.js.map +1 -0
- package/dist/client/sandboxed/wrapper.d.ts +13 -0
- package/dist/client/sandboxed/wrapper.d.ts.map +1 -0
- package/dist/client/sandboxed/wrapper.js +65 -0
- package/dist/client/sandboxed/wrapper.js.map +1 -0
- package/dist/client/sandboxedWorker.d.ts +4 -87
- package/dist/client/sandboxedWorker.d.ts.map +1 -1
- package/dist/client/sandboxedWorker.js +3 -296
- package/dist/client/sandboxedWorker.js.map +1 -1
- package/dist/client/tcp/client.d.ts +40 -0
- package/dist/client/tcp/client.d.ts.map +1 -0
- package/dist/client/tcp/client.js +289 -0
- package/dist/client/tcp/client.js.map +1 -0
- package/dist/client/tcp/connection.d.ts +57 -0
- package/dist/client/tcp/connection.d.ts.map +1 -0
- package/dist/client/tcp/connection.js +162 -0
- package/dist/client/tcp/connection.js.map +1 -0
- package/dist/client/tcp/health.d.ts +47 -0
- package/dist/client/tcp/health.d.ts.map +1 -0
- package/dist/client/tcp/health.js +95 -0
- package/dist/client/tcp/health.js.map +1 -0
- package/dist/client/tcp/index.d.ts +13 -0
- package/dist/client/tcp/index.d.ts.map +1 -0
- package/dist/client/tcp/index.js +12 -0
- package/dist/client/tcp/index.js.map +1 -0
- package/dist/client/tcp/lineBuffer.d.ts +17 -0
- package/dist/client/tcp/lineBuffer.d.ts.map +1 -0
- package/dist/client/tcp/lineBuffer.js +32 -0
- package/dist/client/tcp/lineBuffer.js.map +1 -0
- package/dist/client/tcp/reconnect.d.ts +38 -0
- package/dist/client/tcp/reconnect.d.ts.map +1 -0
- package/dist/client/tcp/reconnect.js +70 -0
- package/dist/client/tcp/reconnect.js.map +1 -0
- package/dist/client/tcp/shared.d.ts +11 -0
- package/dist/client/tcp/shared.d.ts.map +1 -0
- package/dist/client/tcp/shared.js +20 -0
- package/dist/client/tcp/shared.js.map +1 -0
- package/dist/client/tcp/types.d.ts +76 -0
- package/dist/client/tcp/types.d.ts.map +1 -0
- package/dist/client/tcp/types.js +20 -0
- package/dist/client/tcp/types.js.map +1 -0
- package/dist/client/tcpClient.d.ts +4 -110
- package/dist/client/tcpClient.d.ts.map +1 -1
- package/dist/client/tcpClient.js +3 -523
- package/dist/client/tcpClient.js.map +1 -1
- package/dist/client/tcpPool.d.ts +3 -0
- package/dist/client/tcpPool.d.ts.map +1 -1
- package/dist/client/tcpPool.js +21 -2
- package/dist/client/tcpPool.js.map +1 -1
- package/dist/client/types.d.ts +11 -2
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/client/worker/ackBatcher.d.ts +40 -0
- package/dist/client/worker/ackBatcher.d.ts.map +1 -0
- package/dist/client/worker/ackBatcher.js +137 -0
- package/dist/client/worker/ackBatcher.js.map +1 -0
- package/dist/client/worker/index.d.ts +11 -0
- package/dist/client/worker/index.d.ts.map +1 -0
- package/dist/client/worker/index.js +10 -0
- package/dist/client/worker/index.js.map +1 -0
- package/dist/client/worker/jobParser.d.ts +10 -0
- package/dist/client/worker/jobParser.d.ts.map +1 -0
- package/dist/client/worker/jobParser.js +43 -0
- package/dist/client/worker/jobParser.js.map +1 -0
- package/dist/client/worker/processor.d.ts +24 -0
- package/dist/client/worker/processor.d.ts.map +1 -0
- package/dist/client/worker/processor.js +86 -0
- package/dist/client/worker/processor.js.map +1 -0
- package/dist/client/worker/types.d.ts +38 -0
- package/dist/client/worker/types.d.ts.map +1 -0
- package/dist/client/worker/types.js +14 -0
- package/dist/client/worker/types.js.map +1 -0
- package/dist/client/worker/worker.d.ts +53 -0
- package/dist/client/worker/worker.d.ts.map +1 -0
- package/dist/client/worker/worker.js +367 -0
- package/dist/client/worker/worker.js.map +1 -0
- package/dist/client/worker.d.ts +3 -69
- package/dist/client/worker.d.ts.map +1 -1
- package/dist/client/worker.js +3 -472
- package/dist/client/worker.js.map +1 -1
- package/dist/domain/queue/shard.d.ts +19 -2
- package/dist/domain/queue/shard.d.ts.map +1 -1
- package/dist/domain/queue/shard.js +36 -4
- package/dist/domain/queue/shard.js.map +1 -1
- package/dist/domain/types/command.d.ts +9 -0
- package/dist/domain/types/command.d.ts.map +1 -1
- package/dist/domain/types/job.d.ts +27 -0
- package/dist/domain/types/job.d.ts.map +1 -1
- package/dist/domain/types/job.js +34 -0
- package/dist/domain/types/job.js.map +1 -1
- package/dist/domain/types/response.d.ts +15 -1
- package/dist/domain/types/response.d.ts.map +1 -1
- package/dist/domain/types/response.js +16 -0
- package/dist/domain/types/response.js.map +1 -1
- package/dist/infrastructure/server/handlers/core.d.ts +1 -1
- package/dist/infrastructure/server/handlers/core.d.ts.map +1 -1
- package/dist/infrastructure/server/handlers/core.js +74 -15
- package/dist/infrastructure/server/handlers/core.js.map +1 -1
- package/dist/infrastructure/server/handlers/monitoring.d.ts.map +1 -1
- package/dist/infrastructure/server/handlers/monitoring.js +6 -4
- package/dist/infrastructure/server/handlers/monitoring.js.map +1 -1
- package/dist/infrastructure/server/http.d.ts +10 -3
- package/dist/infrastructure/server/http.d.ts.map +1 -1
- package/dist/infrastructure/server/http.js +244 -163
- package/dist/infrastructure/server/http.js.map +1 -1
- package/dist/infrastructure/server/tcp.d.ts +8 -3
- package/dist/infrastructure/server/tcp.d.ts.map +1 -1
- package/dist/infrastructure/server/tcp.js +77 -57
- package/dist/infrastructure/server/tcp.js.map +1 -1
- package/dist/infrastructure/server/types.d.ts +2 -0
- package/dist/infrastructure/server/types.d.ts.map +1 -1
- package/dist/main.js +24 -4
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Connection Handler
|
|
3
|
+
* Manages low-level socket connection and data handling
|
|
4
|
+
*/
|
|
5
|
+
import type { SocketWrapper, PendingCommand } from './types';
|
|
6
|
+
/** Connection events */
|
|
7
|
+
export interface ConnectionEvents {
|
|
8
|
+
onData: (line: string) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onError: (error: Error) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Connection result */
|
|
13
|
+
export interface ConnectionResult {
|
|
14
|
+
socket: SocketWrapper;
|
|
15
|
+
cleanup: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** Connection target - either Unix socket or TCP */
|
|
18
|
+
export interface ConnectionTarget {
|
|
19
|
+
/** Unix socket path (takes priority if set) */
|
|
20
|
+
socketPath?: string;
|
|
21
|
+
/** TCP host (used if socketPath not set) */
|
|
22
|
+
host?: string;
|
|
23
|
+
/** TCP port (used if socketPath not set) */
|
|
24
|
+
port?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Establish connection to server (Unix socket or TCP)
|
|
28
|
+
*/
|
|
29
|
+
export declare function createConnection(target: ConnectionTarget, connectTimeout: number, events: ConnectionEvents): Promise<ConnectionResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Command queue for managing pending commands
|
|
32
|
+
*/
|
|
33
|
+
export declare class CommandQueue {
|
|
34
|
+
private readonly pendingCommands;
|
|
35
|
+
private pendingQueue;
|
|
36
|
+
private currentCommand;
|
|
37
|
+
private commandIdCounter;
|
|
38
|
+
/** Get current command being processed */
|
|
39
|
+
getCurrentCommand(): PendingCommand | null;
|
|
40
|
+
/** Set current command */
|
|
41
|
+
setCurrentCommand(cmd: PendingCommand | null): void;
|
|
42
|
+
/** Check if has pending commands */
|
|
43
|
+
hasPending(): boolean;
|
|
44
|
+
/** Add command to queue */
|
|
45
|
+
enqueue(command: PendingCommand): void;
|
|
46
|
+
/** Get next command ID */
|
|
47
|
+
nextId(): number;
|
|
48
|
+
/** Dequeue next command */
|
|
49
|
+
dequeue(): PendingCommand | null;
|
|
50
|
+
/** Remove command by ID */
|
|
51
|
+
remove(id: number): boolean;
|
|
52
|
+
/** Reject all pending commands */
|
|
53
|
+
rejectAll(error: Error): void;
|
|
54
|
+
/** Clear current command with optional rejection */
|
|
55
|
+
clearCurrent(error?: Error): void;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/client/tcp/connection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG7D,wBAAwB;AACxB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC;AAED,wBAAwB;AACxB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,gBAAgB,EACxB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAiF3B;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0C;IAC1E,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,gBAAgB,CAAK;IAE7B,0CAA0C;IAC1C,iBAAiB,IAAI,cAAc,GAAG,IAAI;IAI1C,0BAA0B;IAC1B,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI;IAInD,oCAAoC;IACpC,UAAU,IAAI,OAAO;IAIrB,2BAA2B;IAC3B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAKtC,0BAA0B;IAC1B,MAAM,IAAI,MAAM;IAIhB,2BAA2B;IAC3B,OAAO,IAAI,cAAc,GAAG,IAAI;IAWhC,2BAA2B;IAC3B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAW3B,kCAAkC;IAClC,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAe7B,oDAAoD;IACpD,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;CASlC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Connection Handler
|
|
3
|
+
* Manages low-level socket connection and data handling
|
|
4
|
+
*/
|
|
5
|
+
import { LineBuffer } from './lineBuffer';
|
|
6
|
+
/**
|
|
7
|
+
* Establish connection to server (Unix socket or TCP)
|
|
8
|
+
*/
|
|
9
|
+
export async function createConnection(target, connectTimeout, events) {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const socketData = {
|
|
12
|
+
write: () => { },
|
|
13
|
+
end: () => { },
|
|
14
|
+
lineBuffer: new LineBuffer(),
|
|
15
|
+
};
|
|
16
|
+
let connectionResolved = false;
|
|
17
|
+
let timeoutId = null;
|
|
18
|
+
const cleanup = () => {
|
|
19
|
+
if (timeoutId) {
|
|
20
|
+
clearTimeout(timeoutId);
|
|
21
|
+
timeoutId = null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const targetDesc = target.socketPath ?? `${target.host}:${target.port}`;
|
|
25
|
+
// Socket handlers
|
|
26
|
+
const socketHandlers = {
|
|
27
|
+
data(_sock, data) {
|
|
28
|
+
const lines = socketData.lineBuffer.addData(data.toString());
|
|
29
|
+
for (const line of lines) {
|
|
30
|
+
events.onData(line);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
open(sock) {
|
|
34
|
+
cleanup();
|
|
35
|
+
socketData.write = (d) => sock.write(d);
|
|
36
|
+
socketData.end = () => sock.end();
|
|
37
|
+
connectionResolved = true;
|
|
38
|
+
resolve({ socket: socketData, cleanup });
|
|
39
|
+
},
|
|
40
|
+
close() {
|
|
41
|
+
if (!connectionResolved) {
|
|
42
|
+
connectionResolved = true;
|
|
43
|
+
cleanup();
|
|
44
|
+
reject(new Error('Connection closed'));
|
|
45
|
+
}
|
|
46
|
+
events.onClose();
|
|
47
|
+
},
|
|
48
|
+
error(_sock, error) {
|
|
49
|
+
if (!connectionResolved) {
|
|
50
|
+
connectionResolved = true;
|
|
51
|
+
cleanup();
|
|
52
|
+
reject(new Error(`Connection error: ${error.message}`));
|
|
53
|
+
}
|
|
54
|
+
events.onError(error);
|
|
55
|
+
},
|
|
56
|
+
connectError(_sock, error) {
|
|
57
|
+
if (!connectionResolved) {
|
|
58
|
+
connectionResolved = true;
|
|
59
|
+
cleanup();
|
|
60
|
+
reject(new Error(`Failed to connect to ${targetDesc}: ${error.message}`));
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
// Connect using Unix socket or TCP based on target
|
|
65
|
+
if (target.socketPath) {
|
|
66
|
+
void Bun.connect({
|
|
67
|
+
unix: target.socketPath,
|
|
68
|
+
socket: socketHandlers,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
void Bun.connect({
|
|
73
|
+
hostname: target.host ?? 'localhost',
|
|
74
|
+
port: target.port ?? 6789,
|
|
75
|
+
socket: socketHandlers,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
timeoutId = setTimeout(() => {
|
|
79
|
+
if (!connectionResolved) {
|
|
80
|
+
connectionResolved = true;
|
|
81
|
+
reject(new Error(`Connection timeout to ${targetDesc}`));
|
|
82
|
+
}
|
|
83
|
+
}, connectTimeout);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Command queue for managing pending commands
|
|
88
|
+
*/
|
|
89
|
+
export class CommandQueue {
|
|
90
|
+
pendingCommands = new Map();
|
|
91
|
+
pendingQueue = [];
|
|
92
|
+
currentCommand = null;
|
|
93
|
+
commandIdCounter = 0;
|
|
94
|
+
/** Get current command being processed */
|
|
95
|
+
getCurrentCommand() {
|
|
96
|
+
return this.currentCommand;
|
|
97
|
+
}
|
|
98
|
+
/** Set current command */
|
|
99
|
+
setCurrentCommand(cmd) {
|
|
100
|
+
this.currentCommand = cmd;
|
|
101
|
+
}
|
|
102
|
+
/** Check if has pending commands */
|
|
103
|
+
hasPending() {
|
|
104
|
+
return this.pendingCommands.size > 0;
|
|
105
|
+
}
|
|
106
|
+
/** Add command to queue */
|
|
107
|
+
enqueue(command) {
|
|
108
|
+
this.pendingCommands.set(command.id, command);
|
|
109
|
+
this.pendingQueue.push(command.id);
|
|
110
|
+
}
|
|
111
|
+
/** Get next command ID */
|
|
112
|
+
nextId() {
|
|
113
|
+
return ++this.commandIdCounter;
|
|
114
|
+
}
|
|
115
|
+
/** Dequeue next command */
|
|
116
|
+
dequeue() {
|
|
117
|
+
const nextId = this.pendingQueue.shift();
|
|
118
|
+
if (nextId === undefined)
|
|
119
|
+
return null;
|
|
120
|
+
const next = this.pendingCommands.get(nextId);
|
|
121
|
+
if (!next)
|
|
122
|
+
return null;
|
|
123
|
+
this.pendingCommands.delete(nextId);
|
|
124
|
+
return next;
|
|
125
|
+
}
|
|
126
|
+
/** Remove command by ID */
|
|
127
|
+
remove(id) {
|
|
128
|
+
if (!this.pendingCommands.has(id))
|
|
129
|
+
return false;
|
|
130
|
+
this.pendingCommands.delete(id);
|
|
131
|
+
const queueIdx = this.pendingQueue.indexOf(id);
|
|
132
|
+
if (queueIdx !== -1) {
|
|
133
|
+
this.pendingQueue.splice(queueIdx, 1);
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
/** Reject all pending commands */
|
|
138
|
+
rejectAll(error) {
|
|
139
|
+
for (const cmd of this.pendingCommands.values()) {
|
|
140
|
+
clearTimeout(cmd.timeout);
|
|
141
|
+
cmd.reject(error);
|
|
142
|
+
}
|
|
143
|
+
this.pendingCommands.clear();
|
|
144
|
+
this.pendingQueue = [];
|
|
145
|
+
if (this.currentCommand) {
|
|
146
|
+
clearTimeout(this.currentCommand.timeout);
|
|
147
|
+
this.currentCommand.reject(error);
|
|
148
|
+
this.currentCommand = null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** Clear current command with optional rejection */
|
|
152
|
+
clearCurrent(error) {
|
|
153
|
+
if (this.currentCommand) {
|
|
154
|
+
clearTimeout(this.currentCommand.timeout);
|
|
155
|
+
if (error) {
|
|
156
|
+
this.currentCommand.reject(error);
|
|
157
|
+
}
|
|
158
|
+
this.currentCommand = null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/client/tcp/connection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAyB1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAwB,EACxB,cAAsB,EACtB,MAAwB;IAExB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,UAAU,GAAkB;YAChC,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;YACf,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC;YACb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 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Health Tracker
|
|
3
|
+
* Monitors connection health with ping and latency tracking
|
|
4
|
+
*/
|
|
5
|
+
import type { ConnectionHealth } from './types';
|
|
6
|
+
/** Health tracker configuration */
|
|
7
|
+
export interface HealthConfig {
|
|
8
|
+
pingInterval: number;
|
|
9
|
+
maxPingFailures: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Tracks connection health metrics
|
|
13
|
+
*/
|
|
14
|
+
export declare class HealthTracker {
|
|
15
|
+
private readonly config;
|
|
16
|
+
private consecutivePingFailures;
|
|
17
|
+
private lastSuccessAt;
|
|
18
|
+
private lastErrorAt;
|
|
19
|
+
private connectedAt;
|
|
20
|
+
private totalCommands;
|
|
21
|
+
private totalErrors;
|
|
22
|
+
private readonly latencyHistory;
|
|
23
|
+
private pingTimer;
|
|
24
|
+
private static readonly MAX_LATENCY_HISTORY;
|
|
25
|
+
constructor(config: HealthConfig);
|
|
26
|
+
/** Record successful command */
|
|
27
|
+
recordSuccess(latencyMs: number): void;
|
|
28
|
+
/** Record command error */
|
|
29
|
+
recordError(): void;
|
|
30
|
+
/** Record command sent (for total count) */
|
|
31
|
+
recordCommandSent(): void;
|
|
32
|
+
/** Record connection established */
|
|
33
|
+
recordConnected(): void;
|
|
34
|
+
/** Record ping success */
|
|
35
|
+
recordPingSuccess(latencyMs: number): void;
|
|
36
|
+
/** Record ping failure, returns true if max failures reached */
|
|
37
|
+
recordPingFailure(): boolean;
|
|
38
|
+
/** Get current health metrics */
|
|
39
|
+
getHealth(state: 'connected' | 'connecting' | 'disconnected' | 'closed'): ConnectionHealth;
|
|
40
|
+
/** Start ping timer */
|
|
41
|
+
startPing(pingFn: () => Promise<void>): void;
|
|
42
|
+
/** Stop ping timer */
|
|
43
|
+
stopPing(): void;
|
|
44
|
+
/** Record latency for averaging */
|
|
45
|
+
private recordLatency;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=health.d.ts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AAI,IAAI;IAOhB,mCAAmC;IACnC,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Health Tracker
|
|
3
|
+
* Monitors connection health with ping and latency tracking
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Tracks connection health metrics
|
|
7
|
+
*/
|
|
8
|
+
export class HealthTracker {
|
|
9
|
+
config;
|
|
10
|
+
consecutivePingFailures = 0;
|
|
11
|
+
lastSuccessAt = null;
|
|
12
|
+
lastErrorAt = null;
|
|
13
|
+
connectedAt = null;
|
|
14
|
+
totalCommands = 0;
|
|
15
|
+
totalErrors = 0;
|
|
16
|
+
latencyHistory = [];
|
|
17
|
+
pingTimer = null;
|
|
18
|
+
static MAX_LATENCY_HISTORY = 10;
|
|
19
|
+
constructor(config) {
|
|
20
|
+
this.config = config;
|
|
21
|
+
}
|
|
22
|
+
/** Record successful command */
|
|
23
|
+
recordSuccess(latencyMs) {
|
|
24
|
+
this.lastSuccessAt = Date.now();
|
|
25
|
+
this.totalCommands++;
|
|
26
|
+
this.recordLatency(latencyMs);
|
|
27
|
+
}
|
|
28
|
+
/** Record command error */
|
|
29
|
+
recordError() {
|
|
30
|
+
this.lastErrorAt = Date.now();
|
|
31
|
+
this.totalErrors++;
|
|
32
|
+
}
|
|
33
|
+
/** Record command sent (for total count) */
|
|
34
|
+
recordCommandSent() {
|
|
35
|
+
this.totalCommands++;
|
|
36
|
+
}
|
|
37
|
+
/** Record connection established */
|
|
38
|
+
recordConnected() {
|
|
39
|
+
this.connectedAt = Date.now();
|
|
40
|
+
this.consecutivePingFailures = 0;
|
|
41
|
+
}
|
|
42
|
+
/** Record ping success */
|
|
43
|
+
recordPingSuccess(latencyMs) {
|
|
44
|
+
this.consecutivePingFailures = 0;
|
|
45
|
+
this.recordLatency(latencyMs);
|
|
46
|
+
}
|
|
47
|
+
/** Record ping failure, returns true if max failures reached */
|
|
48
|
+
recordPingFailure() {
|
|
49
|
+
this.consecutivePingFailures++;
|
|
50
|
+
this.lastErrorAt = Date.now();
|
|
51
|
+
this.totalErrors++;
|
|
52
|
+
return this.consecutivePingFailures >= this.config.maxPingFailures;
|
|
53
|
+
}
|
|
54
|
+
/** Get current health metrics */
|
|
55
|
+
getHealth(state) {
|
|
56
|
+
const avgLatency = this.latencyHistory.length > 0
|
|
57
|
+
? this.latencyHistory.reduce((a, b) => a + b, 0) / this.latencyHistory.length
|
|
58
|
+
: 0;
|
|
59
|
+
return {
|
|
60
|
+
healthy: state === 'connected' && this.consecutivePingFailures < this.config.maxPingFailures,
|
|
61
|
+
state,
|
|
62
|
+
lastSuccessAt: this.lastSuccessAt,
|
|
63
|
+
lastErrorAt: this.lastErrorAt,
|
|
64
|
+
avgLatencyMs: Math.round(avgLatency * 100) / 100,
|
|
65
|
+
consecutivePingFailures: this.consecutivePingFailures,
|
|
66
|
+
totalCommands: this.totalCommands,
|
|
67
|
+
totalErrors: this.totalErrors,
|
|
68
|
+
uptimeMs: this.connectedAt ? Date.now() - this.connectedAt : 0,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Start ping timer */
|
|
72
|
+
startPing(pingFn) {
|
|
73
|
+
if (this.config.pingInterval <= 0)
|
|
74
|
+
return;
|
|
75
|
+
this.stopPing();
|
|
76
|
+
this.pingTimer = setInterval(() => {
|
|
77
|
+
void pingFn();
|
|
78
|
+
}, this.config.pingInterval);
|
|
79
|
+
}
|
|
80
|
+
/** Stop ping timer */
|
|
81
|
+
stopPing() {
|
|
82
|
+
if (this.pingTimer) {
|
|
83
|
+
clearInterval(this.pingTimer);
|
|
84
|
+
this.pingTimer = null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Record latency for averaging */
|
|
88
|
+
recordLatency(latencyMs) {
|
|
89
|
+
this.latencyHistory.push(latencyMs);
|
|
90
|
+
if (this.latencyHistory.length > HealthTracker.MAX_LATENCY_HISTORY) {
|
|
91
|
+
this.latencyHistory.shift();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../../src/client/tcp/health.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;GAEG;AACH,MAAM,OAAO,aAAa;IAYK;IAXrB,uBAAuB,GAAG,CAAC,CAAC;IAC5B,aAAa,GAAkB,IAAI,CAAC;IACpC,WAAW,GAAkB,IAAI,CAAC;IAClC,WAAW,GAAkB,IAAI,CAAC;IAClC,aAAa,GAAG,CAAC,CAAC;IAClB,WAAW,GAAG,CAAC,CAAC;IACP,cAAc,GAAa,EAAE,CAAC;IACvC,SAAS,GAA0C,IAAI,CAAC;IAExD,MAAM,CAAU,mBAAmB,GAAG,EAAE,CAAC;IAEjD,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAErD,gCAAgC;IAChC,aAAa,CAAC,SAAiB;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,2BAA2B;IAC3B,WAAW;QACT,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,4CAA4C;IAC5C,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,oCAAoC;IACpC,eAAe;QACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,0BAA0B;IAC1B,iBAAiB,CAAC,SAAiB;QACjC,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAA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AAY,IAAI,CAAC;YAAE,OAAO;QAC1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,KAAK,MAAM,EAAE,CAAC;QAChB,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAED,sBAAsB;IACtB,QAAQ;QACN,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;IACH,CAAC;IAED,mCAAmC;IAC3B,aAAa,CAAC,SAAiB;QACrC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,aAAa,CAAC,mBAAmB,EAAE,CAAC;YACnE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Client Module
|
|
3
|
+
* Re-exports all TCP client components
|
|
4
|
+
*/
|
|
5
|
+
export type { ConnectionOptions, ConnectionHealth, PendingCommand, SocketWrapper } from './types';
|
|
6
|
+
export { DEFAULT_CONNECTION } from './types';
|
|
7
|
+
export { LineBuffer } from './lineBuffer';
|
|
8
|
+
export { HealthTracker, type HealthConfig } from './health';
|
|
9
|
+
export { ReconnectManager, type ReconnectConfig } from './reconnect';
|
|
10
|
+
export { createConnection, CommandQueue } from './connection';
|
|
11
|
+
export { TcpClient } from './client';
|
|
12
|
+
export { getSharedTcpClient, closeSharedTcpClient } from './shared';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/tcp/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Client Module
|
|
3
|
+
* Re-exports all TCP client components
|
|
4
|
+
*/
|
|
5
|
+
export { DEFAULT_CONNECTION } from './types';
|
|
6
|
+
export { LineBuffer } from './lineBuffer';
|
|
7
|
+
export { HealthTracker } from './health';
|
|
8
|
+
export { ReconnectManager } from './reconnect';
|
|
9
|
+
export { createConnection, CommandQueue } from './connection';
|
|
10
|
+
export { TcpClient } from './client';
|
|
11
|
+
export { getSharedTcpClient, closeSharedTcpClient } from './shared';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/tcp/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAqB,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAwB,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line Buffer
|
|
3
|
+
* Efficient parsing of newline-delimited JSON protocol
|
|
4
|
+
*/
|
|
5
|
+
import type { LineBuffer as ILineBuffer } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Line buffer for efficient parsing of streaming data
|
|
8
|
+
* Handles partial messages across TCP packet boundaries
|
|
9
|
+
*/
|
|
10
|
+
export declare class LineBuffer implements ILineBuffer {
|
|
11
|
+
private partial;
|
|
12
|
+
/** Add data and return complete lines */
|
|
13
|
+
addData(data: string): string[];
|
|
14
|
+
/** Clear buffer */
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=lineBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineBuffer.d.ts","sourceRoot":"","sources":["../../../src/client/tcp/lineBuffer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAEzD;;;GAGG;AACH,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,OAAO,CAAM;IAErB,yCAAyC;IACzC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAkB/B,mBAAmB;IACnB,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line Buffer
|
|
3
|
+
* Efficient parsing of newline-delimited JSON protocol
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Line buffer for efficient parsing of streaming data
|
|
7
|
+
* Handles partial messages across TCP packet boundaries
|
|
8
|
+
*/
|
|
9
|
+
export class LineBuffer {
|
|
10
|
+
partial = '';
|
|
11
|
+
/** Add data and return complete lines */
|
|
12
|
+
addData(data) {
|
|
13
|
+
const combined = this.partial + data;
|
|
14
|
+
const lines = [];
|
|
15
|
+
let start = 0;
|
|
16
|
+
let idx;
|
|
17
|
+
while ((idx = combined.indexOf('\n', start)) !== -1) {
|
|
18
|
+
const line = combined.slice(start, idx);
|
|
19
|
+
if (line.length > 0) {
|
|
20
|
+
lines.push(line);
|
|
21
|
+
}
|
|
22
|
+
start = idx + 1;
|
|
23
|
+
}
|
|
24
|
+
this.partial = start < combined.length ? combined.slice(start) : '';
|
|
25
|
+
return lines;
|
|
26
|
+
}
|
|
27
|
+
/** Clear buffer */
|
|
28
|
+
clear() {
|
|
29
|
+
this.partial = '';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=lineBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineBuffer.js","sourceRoot":"","sources":["../../../src/client/tcp/lineBuffer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,OAAO,UAAU;IACb,OAAO,GAAG,EAAE,CAAC;IAErB,yCAAyC;IACzC,OAAO,CAAC,IAAY;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACrC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,GAAW,CAAC;QAEhB,OAAO,CAAC,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACxC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mBAAmB;IACnB,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Reconnection Manager
|
|
3
|
+
* Handles automatic reconnection with exponential backoff
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
/** Reconnection configuration */
|
|
7
|
+
export interface ReconnectConfig {
|
|
8
|
+
maxReconnectAttempts: number;
|
|
9
|
+
reconnectDelay: number;
|
|
10
|
+
maxReconnectDelay: number;
|
|
11
|
+
autoReconnect: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Manages reconnection attempts with exponential backoff
|
|
15
|
+
*/
|
|
16
|
+
export declare class ReconnectManager extends EventEmitter {
|
|
17
|
+
private readonly config;
|
|
18
|
+
private reconnectAttempts;
|
|
19
|
+
private reconnectTimer;
|
|
20
|
+
private closed;
|
|
21
|
+
constructor(config: ReconnectConfig);
|
|
22
|
+
/** Mark as closed (prevents further reconnects) */
|
|
23
|
+
setClosed(closed: boolean): void;
|
|
24
|
+
/** Check if closed */
|
|
25
|
+
isClosed(): boolean;
|
|
26
|
+
/** Reset reconnect attempts (call on successful connect) */
|
|
27
|
+
reset(): void;
|
|
28
|
+
/** Cancel pending reconnection */
|
|
29
|
+
cancelReconnect(): void;
|
|
30
|
+
/** Check if reconnection is allowed */
|
|
31
|
+
canReconnect(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Schedule reconnection with exponential backoff
|
|
34
|
+
* Returns false if max attempts reached
|
|
35
|
+
*/
|
|
36
|
+
scheduleReconnect(connectFn: () => Promise<void>): boolean;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=reconnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconnect.d.ts","sourceRoot":"","sources":["../../../src/client/tcp/reconnect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,iCAAiC;AACjC,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAKpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJnC,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,MAAM,CAAS;gBAEM,MAAM,EAAE,eAAe;IAIpD,mDAAmD;IACnD,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAOhC,sBAAsB;IACtB,QAAQ,IAAI,OAAO;IAInB,4DAA4D;IAC5D,KAAK,IAAI,IAAI;IAIb,kCAAkC;IAClC,eAAe,IAAI,IAAI;IAOvB,uCAAuC;IACvC,YAAY,IAAI,OAAO;IAIvB;;;OAGG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO;CA6B3D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TCP Reconnection Manager
|
|
3
|
+
* Handles automatic reconnection with exponential backoff
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
/**
|
|
7
|
+
* Manages reconnection attempts with exponential backoff
|
|
8
|
+
*/
|
|
9
|
+
export class ReconnectManager extends EventEmitter {
|
|
10
|
+
config;
|
|
11
|
+
reconnectAttempts = 0;
|
|
12
|
+
reconnectTimer = null;
|
|
13
|
+
closed = false;
|
|
14
|
+
constructor(config) {
|
|
15
|
+
super();
|
|
16
|
+
this.config = config;
|
|
17
|
+
}
|
|
18
|
+
/** Mark as closed (prevents further reconnects) */
|
|
19
|
+
setClosed(closed) {
|
|
20
|
+
this.closed = closed;
|
|
21
|
+
if (closed) {
|
|
22
|
+
this.cancelReconnect();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Check if closed */
|
|
26
|
+
isClosed() {
|
|
27
|
+
return this.closed;
|
|
28
|
+
}
|
|
29
|
+
/** Reset reconnect attempts (call on successful connect) */
|
|
30
|
+
reset() {
|
|
31
|
+
this.reconnectAttempts = 0;
|
|
32
|
+
}
|
|
33
|
+
/** Cancel pending reconnection */
|
|
34
|
+
cancelReconnect() {
|
|
35
|
+
if (this.reconnectTimer) {
|
|
36
|
+
clearTimeout(this.reconnectTimer);
|
|
37
|
+
this.reconnectTimer = null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Check if reconnection is allowed */
|
|
41
|
+
canReconnect() {
|
|
42
|
+
return this.config.autoReconnect && !this.closed;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Schedule reconnection with exponential backoff
|
|
46
|
+
* Returns false if max attempts reached
|
|
47
|
+
*/
|
|
48
|
+
scheduleReconnect(connectFn) {
|
|
49
|
+
if (this.reconnectTimer || this.closed)
|
|
50
|
+
return false;
|
|
51
|
+
this.reconnectAttempts++;
|
|
52
|
+
if (this.reconnectAttempts > this.config.maxReconnectAttempts) {
|
|
53
|
+
this.emit('maxReconnectAttemptsReached');
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// Exponential backoff with jitter
|
|
57
|
+
const baseDelay = Math.min(this.config.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1), this.config.maxReconnectDelay);
|
|
58
|
+
const jitter = Math.random() * 0.3 * baseDelay;
|
|
59
|
+
const delay = baseDelay + jitter;
|
|
60
|
+
this.emit('reconnecting', { attempt: this.reconnectAttempts, delay });
|
|
61
|
+
this.reconnectTimer = setTimeout(() => {
|
|
62
|
+
this.reconnectTimer = null;
|
|
63
|
+
connectFn().catch(() => {
|
|
64
|
+
// connect() will schedule another reconnect if needed
|
|
65
|
+
});
|
|
66
|
+
}, delay);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=reconnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconnect.js","sourceRoot":"","sources":["../../../src/client/tcp/reconnect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAUtC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAKnB;IAJrB,iBAAiB,GAAG,CAAC,CAAC;IACtB,cAAc,GAAyC,IAAI,CAAC;IAC5D,MAAM,GAAG,KAAK,CAAC;IAEvB,YAA6B,MAAuB;QAClD,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAiB;IAEpD,CAAC;IAED,mDAAmD;IACnD,SAAS,CAAC,MAAe;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,sBAAsB;IACtB,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,4DAA4D;IAC5D,KAAK;QACH,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,kCAAkC;IAClC,eAAe;QACb,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,YAAY,CAAC,IAAI,CAA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AAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TCP Client Instance
|
|
3
|
+
* Singleton pattern for shared client management
|
|
4
|
+
*/
|
|
5
|
+
import type { ConnectionOptions } from './types';
|
|
6
|
+
import { TcpClient } from './client';
|
|
7
|
+
/** Get shared TCP client */
|
|
8
|
+
export declare function getSharedTcpClient(options?: Partial<ConnectionOptions>): TcpClient;
|
|
9
|
+
/** Close shared client */
|
|
10
|
+
export declare function closeSharedTcpClient(): void;
|
|
11
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/client/tcp/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrC,4BAA4B;AAC5B,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAGlF;AAED,0BAA0B;AAC1B,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TCP Client Instance
|
|
3
|
+
* Singleton pattern for shared client management
|
|
4
|
+
*/
|
|
5
|
+
import { TcpClient } from './client';
|
|
6
|
+
/** Shared client instance */
|
|
7
|
+
let sharedClient = null;
|
|
8
|
+
/** Get shared TCP client */
|
|
9
|
+
export function getSharedTcpClient(options) {
|
|
10
|
+
sharedClient ??= new TcpClient(options);
|
|
11
|
+
return sharedClient;
|
|
12
|
+
}
|
|
13
|
+
/** Close shared client */
|
|
14
|
+
export function closeSharedTcpClient() {
|
|
15
|
+
if (sharedClient) {
|
|
16
|
+
sharedClient.close();
|
|
17
|
+
sharedClient = null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/client/tcp/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,6BAA6B;AAC7B,IAAI,YAAY,GAAqB,IAAI,CAAC;AAE1C,4BAA4B;AAC5B,MAAM,UAAU,kBAAkB,CAAC,OAAoC;IACrE,YAAY,KAAK,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,0BAA0B;AAC1B,MAAM,UAAU,oBAAoB;IAClC,IAAI,YAAY,EAAE,CAAC;QACjB,YAAY,CAAC,KAAK,EAAE,CAAC;QACrB,YAAY,GAAG,IAAI,CAAC;IACtB,CAAC;AACH,CAAC"}
|