@olane/o-client-limited 0.7.37 → 0.7.39
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,11 +1,10 @@
|
|
|
1
|
-
import { Stream } from '@olane/o-config';
|
|
2
1
|
import { oNodeConnection } from '@olane/o-node';
|
|
2
|
+
import type { oNodeConnectionConfig } from '@olane/o-node/src/connection/interfaces/o-node-connection.config.js';
|
|
3
3
|
/**
|
|
4
4
|
* oLimitedConnection extends oNodeConnection with stream reuse enabled
|
|
5
5
|
* This is optimized for limited connections where creating new streams is expensive
|
|
6
6
|
*/
|
|
7
7
|
export declare class oLimitedConnection extends oNodeConnection {
|
|
8
|
-
|
|
9
|
-
postTransmit(stream: Stream): Promise<void>;
|
|
8
|
+
constructor(config: oNodeConnectionConfig);
|
|
10
9
|
}
|
|
11
10
|
//# sourceMappingURL=o-limited-connection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-limited-connection.d.ts","sourceRoot":"","sources":["../../../src/connection/o-limited-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"o-limited-connection.d.ts","sourceRoot":"","sources":["../../../src/connection/o-limited-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAEjH;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACzC,MAAM,EAAE,qBAAqB;CAM1C"}
|
|
@@ -4,24 +4,10 @@ import { oNodeConnection } from '@olane/o-node';
|
|
|
4
4
|
* This is optimized for limited connections where creating new streams is expensive
|
|
5
5
|
*/
|
|
6
6
|
export class oLimitedConnection extends oNodeConnection {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
? parseInt(process.env.MAX_OUTBOUND_STREAMS)
|
|
13
|
-
: 1000,
|
|
14
|
-
runOnLimitedConnection: this.config.runOnLimitedConnection ?? true,
|
|
15
|
-
reusePolicy: 'reuse', // Enable stream reuse
|
|
16
|
-
drainTimeoutMs: this.config.drainTimeoutMs,
|
|
17
|
-
};
|
|
18
|
-
return this.streamHandler.getOrCreateStream(this.p2pConnection, this.nextHopAddress.protocol, streamConfig);
|
|
19
|
-
}
|
|
20
|
-
async postTransmit(stream) {
|
|
21
|
-
// Use StreamHandler with reuse policy - stream won't be closed
|
|
22
|
-
const streamConfig = {
|
|
23
|
-
reusePolicy: 'reuse',
|
|
24
|
-
};
|
|
25
|
-
await this.streamHandler.close(stream, streamConfig);
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
9
|
+
// Override default 'none' policy with 'reuse' for limited connections
|
|
10
|
+
// Can still be overridden via config.reusePolicy
|
|
11
|
+
this.reusePolicy = config.reusePolicy ?? 'reuse';
|
|
26
12
|
}
|
|
27
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-client-limited",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"typescript": "5.4.5"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@olane/o-config": "0.7.
|
|
57
|
-
"@olane/o-core": "0.7.
|
|
58
|
-
"@olane/o-node": "0.7.
|
|
59
|
-
"@olane/o-protocol": "0.7.
|
|
60
|
-
"@olane/o-tool": "0.7.
|
|
56
|
+
"@olane/o-config": "0.7.39",
|
|
57
|
+
"@olane/o-core": "0.7.39",
|
|
58
|
+
"@olane/o-node": "0.7.39",
|
|
59
|
+
"@olane/o-protocol": "0.7.39",
|
|
60
|
+
"@olane/o-tool": "0.7.39",
|
|
61
61
|
"debug": "^4.4.1",
|
|
62
62
|
"dotenv": "^16.5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "9c992e3bda91a7d2b587392a1db5cff47a2ca23a"
|
|
65
65
|
}
|