@libp2p/utils 6.6.2-f1de46607 → 6.6.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/src/adaptive-timeout.d.ts +1 -2
- package/dist/src/adaptive-timeout.d.ts.map +1 -1
- package/dist/src/adaptive-timeout.js +1 -1
- package/dist/src/adaptive-timeout.js.map +1 -1
- package/dist/src/queue/index.d.ts +2 -0
- package/dist/src/queue/index.d.ts.map +1 -1
- package/dist/src/queue/index.js +17 -10
- package/dist/src/queue/index.js.map +1 -1
- package/dist/typedoc-urls.json +141 -0
- package/package.json +5 -5
- package/src/adaptive-timeout.ts +1 -2
- package/src/queue/index.ts +22 -10
|
@@ -2,7 +2,7 @@ import { type ClearableSignal } from 'any-signal';
|
|
|
2
2
|
import type { Metrics } from '@libp2p/interface';
|
|
3
3
|
export declare const DEFAULT_TIMEOUT_MULTIPLIER = 1.2;
|
|
4
4
|
export declare const DEFAULT_FAILURE_MULTIPLIER = 2;
|
|
5
|
-
export declare const DEFAULT_MIN_TIMEOUT =
|
|
5
|
+
export declare const DEFAULT_MIN_TIMEOUT = 5000;
|
|
6
6
|
export interface AdaptiveTimeoutSignal extends ClearableSignal {
|
|
7
7
|
start: number;
|
|
8
8
|
timeout: number;
|
|
@@ -11,7 +11,6 @@ export interface AdaptiveTimeoutInit {
|
|
|
11
11
|
metricName?: string;
|
|
12
12
|
metrics?: Metrics;
|
|
13
13
|
interval?: number;
|
|
14
|
-
initialValue?: number;
|
|
15
14
|
timeoutMultiplier?: number;
|
|
16
15
|
failureMultiplier?: number;
|
|
17
16
|
minTimeout?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptive-timeout.d.ts","sourceRoot":"","sources":["../../src/adaptive-timeout.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,KAAK,EAAe,OAAO,EAAE,MAAM,mBAAmB,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AO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAa;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEtB,IAAI,GAAE,mBAAwB;IAa3C,gBAAgB,CAAE,OAAO,GAAE,uBAA4B,GAAG,qBAAqB;IAiB/E,OAAO,CAAE,MAAM,EAAE,qBAAqB,GAAG,IAAI;CAyB9C"}
|
|
@@ -3,7 +3,7 @@ import { anySignal } from 'any-signal';
|
|
|
3
3
|
import { MovingAverage } from './moving-average.js';
|
|
4
4
|
export const DEFAULT_TIMEOUT_MULTIPLIER = 1.2;
|
|
5
5
|
export const DEFAULT_FAILURE_MULTIPLIER = 2;
|
|
6
|
-
export const DEFAULT_MIN_TIMEOUT =
|
|
6
|
+
export const DEFAULT_MIN_TIMEOUT = 5000;
|
|
7
7
|
export class AdaptiveTimeout {
|
|
8
8
|
success;
|
|
9
9
|
failure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptive-timeout.js","sourceRoot":"","sources":["../../src/adaptive-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAwB,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"adaptive-timeout.js","sourceRoot":"","sources":["../../src/adaptive-timeout.ts"],"names":[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ACvB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;gBAClB,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;gBAChD,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;gBACxC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;gBACtC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;gBACtC,OAAO,EAAE,IAAI;aACd,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -103,6 +103,8 @@ export declare class Queue<JobReturnType = unknown, JobOptions extends AbortOpti
|
|
|
103
103
|
private pending;
|
|
104
104
|
private readonly sort?;
|
|
105
105
|
constructor(init?: QueueInit<JobReturnType, JobOptions>);
|
|
106
|
+
emitEmpty(): void;
|
|
107
|
+
emitIdle(): void;
|
|
106
108
|
private tryToStartAnother;
|
|
107
109
|
private enqueue;
|
|
108
110
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAKjE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE9D,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,CAAC,CAAC,EAAE,CAAC,EAAE,C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K,IAAK,IAAI;IAId;;OAEG;IACH,KAAK,IAAK,IAAI;IAQd;;;;OAIG;IACG,OAAO,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IASrD;;;;;;;;;;OAUG;IACG,cAAc,CAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3E;;;;;;;OAOG;IACG,MAAM,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IASpD;;OAEG;IACH,IAAI,IAAI,IAAK,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,MAAM,IAAK,MAAM,CAEpB;IAED;;OAEG;IACH,IAAI,OAAO,IAAK,MAAM,CAErB;IAED;;;;;;;;;OASG;IACK,WAAW,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC;CAuD3F"}
|
package/dist/src/queue/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbortError, TypedEventEmitter } from '@libp2p/interface';
|
|
2
2
|
import { pushable } from 'it-pushable';
|
|
3
3
|
import { raceEvent } from 'race-event';
|
|
4
|
+
import { debounce } from '../debounce.js';
|
|
4
5
|
import { QueueFullError } from '../errors.js';
|
|
5
6
|
import { Job } from './job.js';
|
|
6
7
|
/**
|
|
@@ -33,20 +34,26 @@ export class Queue extends TypedEventEmitter {
|
|
|
33
34
|
}
|
|
34
35
|
this.sort = init.sort;
|
|
35
36
|
this.queue = [];
|
|
37
|
+
this.emitEmpty = debounce(this.emitEmpty.bind(this), 1);
|
|
38
|
+
this.emitIdle = debounce(this.emitIdle.bind(this), 1);
|
|
39
|
+
}
|
|
40
|
+
emitEmpty() {
|
|
41
|
+
if (this.size !== 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.safeDispatchEvent('empty');
|
|
45
|
+
}
|
|
46
|
+
emitIdle() {
|
|
47
|
+
if (this.running !== 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.safeDispatchEvent('idle');
|
|
36
51
|
}
|
|
37
52
|
tryToStartAnother() {
|
|
38
53
|
if (this.size === 0) {
|
|
39
|
-
|
|
40
|
-
// result before the "empty" event fires
|
|
41
|
-
queueMicrotask(() => {
|
|
42
|
-
this.safeDispatchEvent('empty');
|
|
43
|
-
});
|
|
54
|
+
this.emitEmpty();
|
|
44
55
|
if (this.running === 0) {
|
|
45
|
-
|
|
46
|
-
// result before the "idle" event fires
|
|
47
|
-
queueMicrotask(() => {
|
|
48
|
-
this.safeDispatchEvent('idle');
|
|
49
|
-
});
|
|
56
|
+
this.emitIdle();
|
|
50
57
|
}
|
|
51
58
|
return false;
|
|
52
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAiH9B;;;;;GAKG;AACH,MAAM,OAAO,KAA+E,SAAQ,iBAAyD;IACpJ,WAAW,CAAQ;IACnB,OAAO,CAAQ;IACf,KAAK,CAAuC;IAC3C,OAAO,CAAQ;IACN,IAAI,CAA6C;IAElE,YAAa,OAA6C,EAAE;QAC1D,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,iBAAiB,CAAA;QAC/D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,iBAAiB,CAAA;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,CAAC;QACH,CAAC,CAAA;QAED,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAQ,EAAE;YACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,GAAS,EAAE;YAC7B,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;QAED,oDAAoD;QACpD,MAAM,aAAa,GAAG,GAAS,EAAE;YAC/B,OAAO,CAAC,IAAI,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAA;QAED,gBAAgB;QAChB,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;QACtD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QAC5C,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAC1C,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;QAEzD,IAAI,CAAC;YACH,KAAM,CAAC,CAAC,MAAM,CAAA;QAChB,CAAC;gBAAS,CAAC;YACT,mBAAmB;YACnB,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;YACzD,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;YAC/C,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;YAC7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;YAE5D,mEAAmE;YACnE,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.abort_options.createTimeoutOptions.html",
|
|
3
|
+
"./abort-options:createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.abort_options.createTimeoutOptions.html",
|
|
4
|
+
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.abstract_stream.AbstractStream.html",
|
|
5
|
+
"./abstract-stream:AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.abstract_stream.AbstractStream.html",
|
|
6
|
+
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.abstract_stream.AbstractStreamInit.html",
|
|
7
|
+
"./abstract-stream:AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.abstract_stream.AbstractStreamInit.html",
|
|
8
|
+
"AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.adaptive_timeout.AdaptiveTimeout.html",
|
|
9
|
+
"./adaptive-timeout:AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.adaptive_timeout.AdaptiveTimeout.html",
|
|
10
|
+
"AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.AdaptiveTimeoutInit.html",
|
|
11
|
+
"./adaptive-timeout:AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.AdaptiveTimeoutInit.html",
|
|
12
|
+
"AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.AdaptiveTimeoutSignal.html",
|
|
13
|
+
"./adaptive-timeout:AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.AdaptiveTimeoutSignal.html",
|
|
14
|
+
"GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.GetTimeoutSignalOptions.html",
|
|
15
|
+
"./adaptive-timeout:GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive_timeout.GetTimeoutSignalOptions.html",
|
|
16
|
+
"DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
17
|
+
"./adaptive-timeout:DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
18
|
+
"DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_MIN_TIMEOUT.html",
|
|
19
|
+
"./adaptive-timeout:DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_MIN_TIMEOUT.html",
|
|
20
|
+
"DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
21
|
+
"./adaptive-timeout:DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive_timeout.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
22
|
+
"arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array_equals.arrayEquals.html",
|
|
23
|
+
"./array-equals:arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array_equals.arrayEquals.html",
|
|
24
|
+
"SafelyCloseConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.close.SafelyCloseConnectionOptions.html",
|
|
25
|
+
"./close:SafelyCloseConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.close.SafelyCloseConnectionOptions.html",
|
|
26
|
+
"safelyCloseConnectionIfUnused": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseConnectionIfUnused.html",
|
|
27
|
+
"./close:safelyCloseConnectionIfUnused": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseConnectionIfUnused.html",
|
|
28
|
+
"safelyCloseStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseStream.html",
|
|
29
|
+
"./close:safelyCloseStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseStream.html",
|
|
30
|
+
"closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close_source.closeSource.html",
|
|
31
|
+
"./close-source:closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close_source.closeSource.html",
|
|
32
|
+
"DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.debounce.DebouncedFunction.html",
|
|
33
|
+
"./debounce:DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.debounce.DebouncedFunction.html",
|
|
34
|
+
"debounce": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.debounce.debounce.html",
|
|
35
|
+
"./debounce:debounce": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.debounce.debounce.html",
|
|
36
|
+
"BloomFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.filters.BloomFilter.html",
|
|
37
|
+
"Bucket": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.filters.Bucket.html",
|
|
38
|
+
"CuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.filters.CuckooFilter.html",
|
|
39
|
+
"Fingerprint": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.filters.Fingerprint.html",
|
|
40
|
+
"ScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.filters.ScalableCuckooFilter.html",
|
|
41
|
+
"BloomFilterOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.BloomFilterOptions.html",
|
|
42
|
+
"CuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.CuckooFilterInit.html",
|
|
43
|
+
"Filter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.Filter.html",
|
|
44
|
+
"./filters:Filter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.Filter.html",
|
|
45
|
+
"Hash": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.Hash.html",
|
|
46
|
+
"ScalableCuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.filters.ScalableCuckooFilterInit.html",
|
|
47
|
+
"createBloomFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createBloomFilter.html",
|
|
48
|
+
"createCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createCuckooFilter.html",
|
|
49
|
+
"createScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createScalableCuckooFilter.html",
|
|
50
|
+
"getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.get_thin_waist_addresses.getThinWaistAddresses.html",
|
|
51
|
+
"./get-thin-waist-addresses:getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.get_thin_waist_addresses.getThinWaistAddresses.html",
|
|
52
|
+
"isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.global_unicast_ip.isGlobalUnicastIp.html",
|
|
53
|
+
"./global-unicast-ip:isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.global_unicast_ip.isGlobalUnicastIp.html",
|
|
54
|
+
"ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip_port_to_multiaddr.ipPortToMultiaddr.html",
|
|
55
|
+
"./ip-port-to-multiaddr:ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip_port_to_multiaddr.ipPortToMultiaddr.html",
|
|
56
|
+
"isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_async_generator.isAsyncGenerator.html",
|
|
57
|
+
"./is-async-generator:isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_async_generator.isAsyncGenerator.html",
|
|
58
|
+
"isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_generator.isGenerator.html",
|
|
59
|
+
"./is-generator:isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_generator.isGenerator.html",
|
|
60
|
+
"isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_promise.isPromise.html",
|
|
61
|
+
"./is-promise:isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is_promise.isPromise.html",
|
|
62
|
+
"isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.link_local_ip.isLinkLocalIp.html",
|
|
63
|
+
"./link-local-ip:isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.link_local_ip.isLinkLocalIp.html",
|
|
64
|
+
"MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.moving_average.MovingAverage.html",
|
|
65
|
+
"./moving-average:MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.moving_average.MovingAverage.html",
|
|
66
|
+
"isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_global_unicast.isGlobalUnicast.html",
|
|
67
|
+
"./multiaddr/is-global-unicast:isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_global_unicast.isGlobalUnicast.html",
|
|
68
|
+
"isIpBased": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_ip_based.isIpBased.html",
|
|
69
|
+
"./multiaddr/is-ip-based:isIpBased": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_ip_based.isIpBased.html",
|
|
70
|
+
"isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_link_local.isLinkLocal.html",
|
|
71
|
+
"./multiaddr/is-link-local:isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_link_local.isLinkLocal.html",
|
|
72
|
+
"isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_loopback.isLoopback.html",
|
|
73
|
+
"./multiaddr/is-loopback:isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_loopback.isLoopback.html",
|
|
74
|
+
"isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_network_address.isNetworkAddress.html",
|
|
75
|
+
"./multiaddr/is-network-address:isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_network_address.isNetworkAddress.html",
|
|
76
|
+
"isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_private.isPrivate.html",
|
|
77
|
+
"./multiaddr/is-private:isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_private.isPrivate.html",
|
|
78
|
+
"PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.peer_queue.PeerQueue.html",
|
|
79
|
+
"./peer-queue:PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.peer_queue.PeerQueue.html",
|
|
80
|
+
"PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.peer_queue.PeerQueueJobOptions.html",
|
|
81
|
+
"./peer-queue:PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.peer_queue.PeerQueueJobOptions.html",
|
|
82
|
+
"PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.priority_queue.PriorityQueue.html",
|
|
83
|
+
"./priority-queue:PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.priority_queue.PriorityQueue.html",
|
|
84
|
+
"PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.priority_queue.PriorityQueueJobOptions.html",
|
|
85
|
+
"./priority-queue:PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.priority_queue.PriorityQueueJobOptions.html",
|
|
86
|
+
"isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.private_ip.isPrivateIp.html",
|
|
87
|
+
"./private-ip:isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.private_ip.isPrivateIp.html",
|
|
88
|
+
"Job": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.Job.html",
|
|
89
|
+
"JobRecipient": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.JobRecipient.html",
|
|
90
|
+
"Queue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.Queue.html",
|
|
91
|
+
"./queue:Queue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.Queue.html",
|
|
92
|
+
"Comparator": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.Comparator.html",
|
|
93
|
+
"./queue:Comparator": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.Comparator.html",
|
|
94
|
+
"JobMatcher": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.JobMatcher.html",
|
|
95
|
+
"./queue:JobMatcher": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.JobMatcher.html",
|
|
96
|
+
"JobTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.JobTimeline.html",
|
|
97
|
+
"QueueEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueEvents.html",
|
|
98
|
+
"./queue:QueueEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueEvents.html",
|
|
99
|
+
"QueueInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueInit.html",
|
|
100
|
+
"./queue:QueueInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueInit.html",
|
|
101
|
+
"QueueJobFailure": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueJobFailure.html",
|
|
102
|
+
"./queue:QueueJobFailure": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueJobFailure.html",
|
|
103
|
+
"QueueJobSuccess": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueJobSuccess.html",
|
|
104
|
+
"./queue:QueueJobSuccess": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.QueueJobSuccess.html",
|
|
105
|
+
"RunFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.RunFunction.html",
|
|
106
|
+
"./queue:RunFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.RunFunction.html",
|
|
107
|
+
"JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.queue.JobStatus.html",
|
|
108
|
+
"./queue:JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.queue.JobStatus.html",
|
|
109
|
+
"MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate_limiter.MemoryStorage.html",
|
|
110
|
+
"./rate-limiter:MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate_limiter.MemoryStorage.html",
|
|
111
|
+
"RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate_limiter.RateLimiter.html",
|
|
112
|
+
"./rate-limiter:RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate_limiter.RateLimiter.html",
|
|
113
|
+
"GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.GetKeySecDurationOptions.html",
|
|
114
|
+
"./rate-limiter:GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.GetKeySecDurationOptions.html",
|
|
115
|
+
"RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateLimiterInit.html",
|
|
116
|
+
"./rate-limiter:RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateLimiterInit.html",
|
|
117
|
+
"RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateLimiterResult.html",
|
|
118
|
+
"./rate-limiter:RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateLimiterResult.html",
|
|
119
|
+
"RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateRecord.html",
|
|
120
|
+
"./rate-limiter:RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate_limiter.RateRecord.html",
|
|
121
|
+
"RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating_task.RepeatingTask.html",
|
|
122
|
+
"./repeating-task:RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating_task.RepeatingTask.html",
|
|
123
|
+
"RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating_task.RepeatingTaskOptions.html",
|
|
124
|
+
"./repeating-task:RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating_task.RepeatingTaskOptions.html",
|
|
125
|
+
"repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeating_task.repeatingTask-1.html",
|
|
126
|
+
"./repeating-task:repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeating_task.repeatingTask-1.html",
|
|
127
|
+
"StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream_to_ma_conn.StreamProperties.html",
|
|
128
|
+
"./stream-to-ma-conn:StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream_to_ma_conn.StreamProperties.html",
|
|
129
|
+
"streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream_to_ma_conn.streamToMaConnection.html",
|
|
130
|
+
"./stream-to-ma-conn:streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream_to_ma_conn.streamToMaConnection.html",
|
|
131
|
+
"CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_list.CreateTrackedListInit.html",
|
|
132
|
+
"./tracked-list:CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_list.CreateTrackedListInit.html",
|
|
133
|
+
"trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked_list.trackedList.html",
|
|
134
|
+
"./tracked-list:trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked_list.trackedList.html",
|
|
135
|
+
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_map.CreateTrackedMapInit.html",
|
|
136
|
+
"./tracked-map:CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_map.CreateTrackedMapInit.html",
|
|
137
|
+
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_map.TrackedMapInit.html",
|
|
138
|
+
"./tracked-map:TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked_map.TrackedMapInit.html",
|
|
139
|
+
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked_map.trackedMap.html",
|
|
140
|
+
"./tracked-map:trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked_map.trackedMap.html"
|
|
141
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.3",
|
|
4
4
|
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/utils#readme",
|
|
@@ -194,9 +194,9 @@
|
|
|
194
194
|
"dependencies": {
|
|
195
195
|
"@chainsafe/is-ip": "^2.0.2",
|
|
196
196
|
"@chainsafe/netmask": "^2.0.0",
|
|
197
|
-
"@libp2p/crypto": "5.1.
|
|
198
|
-
"@libp2p/interface": "2.
|
|
199
|
-
"@libp2p/logger": "5.1.
|
|
197
|
+
"@libp2p/crypto": "^5.1.2",
|
|
198
|
+
"@libp2p/interface": "^2.10.0",
|
|
199
|
+
"@libp2p/logger": "^5.1.16",
|
|
200
200
|
"@multiformats/multiaddr": "^12.3.3",
|
|
201
201
|
"@sindresorhus/fnv1a": "^3.1.0",
|
|
202
202
|
"any-signal": "^4.1.1",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"uint8arrays": "^5.1.0"
|
|
216
216
|
},
|
|
217
217
|
"devDependencies": {
|
|
218
|
-
"@libp2p/peer-id": "5.1.
|
|
218
|
+
"@libp2p/peer-id": "^5.1.3",
|
|
219
219
|
"@types/netmask": "^2.0.5",
|
|
220
220
|
"aegir": "^45.1.1",
|
|
221
221
|
"benchmark": "^2.1.4",
|
package/src/adaptive-timeout.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { MetricGroup, Metrics } from '@libp2p/interface'
|
|
|
5
5
|
|
|
6
6
|
export const DEFAULT_TIMEOUT_MULTIPLIER = 1.2
|
|
7
7
|
export const DEFAULT_FAILURE_MULTIPLIER = 2
|
|
8
|
-
export const DEFAULT_MIN_TIMEOUT =
|
|
8
|
+
export const DEFAULT_MIN_TIMEOUT = 5000
|
|
9
9
|
|
|
10
10
|
export interface AdaptiveTimeoutSignal extends ClearableSignal {
|
|
11
11
|
start: number
|
|
@@ -16,7 +16,6 @@ export interface AdaptiveTimeoutInit {
|
|
|
16
16
|
metricName?: string
|
|
17
17
|
metrics?: Metrics
|
|
18
18
|
interval?: number
|
|
19
|
-
initialValue?: number
|
|
20
19
|
timeoutMultiplier?: number
|
|
21
20
|
failureMultiplier?: number
|
|
22
21
|
minTimeout?: number
|
package/src/queue/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbortError, TypedEventEmitter } from '@libp2p/interface'
|
|
2
2
|
import { pushable } from 'it-pushable'
|
|
3
3
|
import { raceEvent } from 'race-event'
|
|
4
|
+
import { debounce } from '../debounce.js'
|
|
4
5
|
import { QueueFullError } from '../errors.js'
|
|
5
6
|
import { Job } from './job.js'
|
|
6
7
|
import type { AbortOptions, Metrics } from '@libp2p/interface'
|
|
@@ -149,22 +150,33 @@ export class Queue<JobReturnType = unknown, JobOptions extends AbortOptions = Ab
|
|
|
149
150
|
|
|
150
151
|
this.sort = init.sort
|
|
151
152
|
this.queue = []
|
|
153
|
+
|
|
154
|
+
this.emitEmpty = debounce(this.emitEmpty.bind(this), 1)
|
|
155
|
+
this.emitIdle = debounce(this.emitIdle.bind(this), 1)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
emitEmpty (): void {
|
|
159
|
+
if (this.size !== 0) {
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.safeDispatchEvent('empty')
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
emitIdle (): void {
|
|
167
|
+
if (this.running !== 0) {
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
this.safeDispatchEvent('idle')
|
|
152
172
|
}
|
|
153
173
|
|
|
154
174
|
private tryToStartAnother (): boolean {
|
|
155
175
|
if (this.size === 0) {
|
|
156
|
-
|
|
157
|
-
// result before the "empty" event fires
|
|
158
|
-
queueMicrotask(() => {
|
|
159
|
-
this.safeDispatchEvent('empty')
|
|
160
|
-
})
|
|
176
|
+
this.emitEmpty()
|
|
161
177
|
|
|
162
178
|
if (this.running === 0) {
|
|
163
|
-
|
|
164
|
-
// result before the "idle" event fires
|
|
165
|
-
queueMicrotask(() => {
|
|
166
|
-
this.safeDispatchEvent('idle')
|
|
167
|
-
})
|
|
179
|
+
this.emitIdle()
|
|
168
180
|
}
|
|
169
181
|
|
|
170
182
|
return false
|