@peers-app/peers-sdk 0.23.13 → 0.23.14
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/types/peer-device.d.ts +15 -1
- package/dist/types/peer-device.js +15 -1
- package/package.json +1 -1
|
@@ -74,7 +74,21 @@ export interface IDeviceConnection {
|
|
|
74
74
|
/** Shared tuning constants for device synchronization and routing. */
|
|
75
75
|
export declare const PeerDeviceConsts: Readonly<{
|
|
76
76
|
readonly MAX_CONNECTIONS: 30;
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Period of the safety-net election + pull from preferred connections.
|
|
79
|
+
* Each tick is a handful of tiny `getNetworkInfo` RPCs per group and a
|
|
80
|
+
* watermark check, so this is cheap; it bounds how long any missed
|
|
81
|
+
* push can go unnoticed.
|
|
82
|
+
*/
|
|
83
|
+
readonly RESYNC_INTERVAL: 60000;
|
|
84
|
+
/**
|
|
85
|
+
* Delays (ms after a new connection's first election) at which the election
|
|
86
|
+
* is re-run so both sides see each other's settled `preferredDeviceIds`.
|
|
87
|
+
* Two peers that connect at the same time each read the other's network info
|
|
88
|
+
* before the other has finished electing, which otherwise leaves a one-way
|
|
89
|
+
* preferred edge until the next `RESYNC_INTERVAL` tick.
|
|
90
|
+
*/
|
|
91
|
+
readonly ELECTION_SETTLE_DELAYS_MS: readonly number[];
|
|
78
92
|
readonly NOTIFY_CHANGE_DELAY: 100;
|
|
79
93
|
readonly CHANGES_PAGE_SIZE: 100;
|
|
80
94
|
readonly RETRY_COUNT: 2;
|
|
@@ -5,7 +5,21 @@ exports.PeerDeviceConsts = void 0;
|
|
|
5
5
|
exports.PeerDeviceConsts = Object.freeze({
|
|
6
6
|
// TODO set this based on device type (desktops and servers should be able to handle 100 connections)
|
|
7
7
|
MAX_CONNECTIONS: 30,
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Period of the safety-net election + pull from preferred connections.
|
|
10
|
+
* Each tick is a handful of tiny `getNetworkInfo` RPCs per group and a
|
|
11
|
+
* watermark check, so this is cheap; it bounds how long any missed
|
|
12
|
+
* push can go unnoticed.
|
|
13
|
+
*/
|
|
14
|
+
RESYNC_INTERVAL: 60_000,
|
|
15
|
+
/**
|
|
16
|
+
* Delays (ms after a new connection's first election) at which the election
|
|
17
|
+
* is re-run so both sides see each other's settled `preferredDeviceIds`.
|
|
18
|
+
* Two peers that connect at the same time each read the other's network info
|
|
19
|
+
* before the other has finished electing, which otherwise leaves a one-way
|
|
20
|
+
* preferred edge until the next `RESYNC_INTERVAL` tick.
|
|
21
|
+
*/
|
|
22
|
+
ELECTION_SETTLE_DELAYS_MS: [10_000, 30_000],
|
|
9
23
|
NOTIFY_CHANGE_DELAY: 100,
|
|
10
24
|
// CHANGES_PAGE_SIZE: 2_000,
|
|
11
25
|
CHANGES_PAGE_SIZE: 100,
|