@olane/o-client-limited 0.7.38 → 0.7.40

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
- getOrCreateStream(): Promise<Stream>;
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,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IAC/C,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAmBpC,YAAY,CAAC,MAAM,EAAE,MAAM;CAQlC"}
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
- async getOrCreateStream() {
8
- // Override to use 'reuse' policy
9
- const streamConfig = {
10
- signal: this.abortSignal,
11
- maxOutboundStreams: process.env.MAX_OUTBOUND_STREAMS
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.38",
3
+ "version": "0.7.40",
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.38",
57
- "@olane/o-core": "0.7.38",
58
- "@olane/o-node": "0.7.38",
59
- "@olane/o-protocol": "0.7.38",
60
- "@olane/o-tool": "0.7.38",
56
+ "@olane/o-config": "0.7.40",
57
+ "@olane/o-core": "0.7.40",
58
+ "@olane/o-node": "0.7.40",
59
+ "@olane/o-protocol": "0.7.40",
60
+ "@olane/o-tool": "0.7.40",
61
61
  "debug": "^4.4.1",
62
62
  "dotenv": "^16.5.0"
63
63
  },
64
- "gitHead": "61ffeeea7a38c93b3a7d289aff2ed8fe52b6e341"
64
+ "gitHead": "d2d7cb62d69249fe63d4cb293dbbdfc44d250f17"
65
65
  }