@rljson/network 0.0.1 → 0.0.2
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/network-manager.d.ts +4 -4
- package/dist/network.js +2 -1
- package/package.json +4 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { NodeId, NodeInfo } from './types/node-info.ts';
|
|
2
|
-
import { NetworkConfig } from './types/network-config.ts';
|
|
3
|
-
import { NetworkTopology } from './types/network-topology.ts';
|
|
4
|
-
import { TopologyChangedEvent, RoleChangedEvent, HubChangedEvent } from './types/network-events.ts';
|
|
5
1
|
import { NodeIdentity } from './identity/node-identity.ts';
|
|
6
2
|
import { BroadcastLayerDeps } from './layers/broadcast-layer.ts';
|
|
7
3
|
import { CloudLayerDeps } from './layers/cloud-layer.ts';
|
|
8
4
|
import { ProbeScheduler, ProbeFn } from './probing/probe-scheduler.ts';
|
|
5
|
+
import { NetworkConfig } from './types/network-config.ts';
|
|
6
|
+
import { HubChangedEvent, RoleChangedEvent, TopologyChangedEvent } from './types/network-events.ts';
|
|
7
|
+
import { NetworkTopology } from './types/network-topology.ts';
|
|
8
|
+
import { NodeId, NodeInfo } from './types/node-info.ts';
|
|
9
9
|
/** Events emitted by NetworkManager */
|
|
10
10
|
export interface NetworkManagerEvents {
|
|
11
11
|
'topology-changed': (event: TopologyChangedEvent) => void;
|
package/dist/network.js
CHANGED
|
@@ -1574,10 +1574,11 @@ class NetworkManager {
|
|
|
1574
1574
|
this._identity.toNodeInfo(),
|
|
1575
1575
|
...this._peerTable.getPeers()
|
|
1576
1576
|
];
|
|
1577
|
+
const effectiveIncumbent = this._currentHubId === this._identity.nodeId ? null : this._currentHubId;
|
|
1577
1578
|
const result = electHub(
|
|
1578
1579
|
candidates,
|
|
1579
1580
|
probes,
|
|
1580
|
-
|
|
1581
|
+
effectiveIncumbent,
|
|
1581
1582
|
this._identity.nodeId
|
|
1582
1583
|
);
|
|
1583
1584
|
/* v8 ignore else -- @preserve */
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/network",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Networking middle layer providing basic advertising and discovery as well as cloud fall backs and basic config.",
|
|
5
5
|
"homepage": "https://github.com/rljson/network",
|
|
6
6
|
"bugs": "https://github.com/rljson/network/issues",
|
|
7
7
|
"private": false,
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
8
11
|
"license": "MIT",
|
|
9
12
|
"engines": {
|
|
10
13
|
"node": ">=22.14.0"
|