@libp2p/utils 7.0.14 → 7.0.15-b30baa93a
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/index.min.js +4 -4
- package/dist/index.min.js.map +4 -4
- package/dist/src/queue/index.d.ts +2 -1
- package/dist/src/queue/index.d.ts.map +1 -1
- package/dist/src/queue/index.js +3 -2
- package/dist/src/queue/index.js.map +1 -1
- package/dist/src/queue/job.d.ts +3 -2
- package/dist/src/queue/job.d.ts.map +1 -1
- package/dist/src/queue/job.js +9 -4
- package/dist/src/queue/job.js.map +1 -1
- package/dist/src/queue/recipient.d.ts +5 -2
- package/dist/src/queue/recipient.d.ts.map +1 -1
- package/dist/src/queue/recipient.js +4 -2
- package/dist/src/queue/recipient.js.map +1 -1
- package/package.json +7 -6
- package/src/queue/index.ts +7 -3
- package/src/queue/job.ts +11 -5
- package/src/queue/recipient.ts +7 -3
- package/dist/typedoc-urls.json +0 -124
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TypedEventEmitter } from 'main-event';
|
|
2
2
|
import { Job } from './job.js';
|
|
3
3
|
import type { AbortOptions, Metrics } from '@libp2p/interface';
|
|
4
|
+
import type { ProgressOptions } from 'progress-events';
|
|
4
5
|
export type { Job, JobTimeline } from './job.js';
|
|
5
6
|
export type { JobRecipient } from './recipient.js';
|
|
6
7
|
export interface Comparator<T> {
|
|
@@ -92,7 +93,7 @@ export interface QueueEvents<JobReturnType, JobOptions extends AbortOptions = Ab
|
|
|
92
93
|
* 1. Items remain at the head of the queue while they are running so `queue.size` includes `queue.pending` items - this is so interested parties can join the results of a queue item while it is running
|
|
93
94
|
* 2. The options for a job are stored separately to the job in order for them to be modified while they are still in the queue
|
|
94
95
|
*/
|
|
95
|
-
export declare class Queue<JobReturnType = unknown, JobOptions extends AbortOptions = AbortOptions> extends TypedEventEmitter<QueueEvents<JobReturnType, JobOptions>> {
|
|
96
|
+
export declare class Queue<JobReturnType = unknown, JobOptions extends AbortOptions & ProgressOptions = AbortOptions> extends TypedEventEmitter<QueueEvents<JobReturnType, JobOptions>> {
|
|
96
97
|
concurrency: number;
|
|
97
98
|
maxSize: number;
|
|
98
99
|
queue: Array<Job<JobOptions, JobReturnType>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAI9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAI9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,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,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CACzB;AAED,MAAM,WAAW,SAAS,CAAC,aAAa,EAAE,UAAU,SAAS,YAAY,GAAG,YAAY;IACtF;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IAC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E,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
|
@@ -120,8 +120,7 @@ export class Queue extends TypedEventEmitter {
|
|
|
120
120
|
const job = new Job(fn, options);
|
|
121
121
|
this.enqueue(job);
|
|
122
122
|
this.safeDispatchEvent('add');
|
|
123
|
-
|
|
124
|
-
return job.join(options)
|
|
123
|
+
const result = job.join(options)
|
|
125
124
|
.then(result => {
|
|
126
125
|
this.safeDispatchEvent('completed', { detail: result });
|
|
127
126
|
this.safeDispatchEvent('success', { detail: { job, result } });
|
|
@@ -140,6 +139,8 @@ export class Queue extends TypedEventEmitter {
|
|
|
140
139
|
this.safeDispatchEvent('failure', { detail: { job, error: err } });
|
|
141
140
|
throw err;
|
|
142
141
|
});
|
|
142
|
+
this.tryToStartAnother();
|
|
143
|
+
return result;
|
|
143
144
|
}
|
|
144
145
|
/**
|
|
145
146
|
* Clear the queue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,cAAc,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AAC,KAAK,CAAC,CAAA;QAC3B,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,SAAS,EAAE,cAAc,CAAC,CAAA;QAChD,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,SAAS,EAAE,cAAc,CAAC,CAAA;YACnD,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"}
|
package/dist/src/queue/job.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { JobRecipient } from './recipient.js';
|
|
2
2
|
import type { JobStatus } from './index.js';
|
|
3
3
|
import type { AbortOptions } from '@libp2p/interface';
|
|
4
|
+
import type { ProgressOptions } from 'progress-events';
|
|
4
5
|
export interface JobTimeline {
|
|
5
6
|
created: number;
|
|
6
7
|
started?: number;
|
|
7
8
|
finished?: number;
|
|
8
9
|
}
|
|
9
|
-
export declare class Job<JobOptions extends AbortOptions = AbortOptions, JobReturnType = unknown> {
|
|
10
|
+
export declare class Job<JobOptions extends AbortOptions & ProgressOptions = AbortOptions, JobReturnType = unknown> {
|
|
10
11
|
id: string;
|
|
11
12
|
fn: (options: JobOptions) => Promise<JobReturnType>;
|
|
12
13
|
options: JobOptions;
|
|
@@ -17,7 +18,7 @@ export declare class Job<JobOptions extends AbortOptions = AbortOptions, JobRetu
|
|
|
17
18
|
constructor(fn: (options: JobOptions) => Promise<JobReturnType>, options: any);
|
|
18
19
|
abort(err: Error): void;
|
|
19
20
|
onAbort(): void;
|
|
20
|
-
join(options?:
|
|
21
|
+
join(options?: Partial<Pick<JobOptions, 'signal' | 'onProgress'>>): Promise<JobReturnType>;
|
|
21
22
|
run(): Promise<void>;
|
|
22
23
|
cleanup(): void;
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAStD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,GAAG,CAAE,UAAU,SAAS,YAAY,GAAG,eAAe,GAAG,YAAY,EAAE,aAAa,GAAG,OAAO;IAClG,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACnD,OAAO,EAAE,UAAU,CAAA;IACnB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9C,MAAM,EAAE,SAAS,CAAA;IACxB,SAAgB,QAAQ,EAAE,WAAW,CAAA;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;gBAE/B,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,GAAG;IAgB9E,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IAIxB,OAAO,IAAK,IAAI;IAYV,IAAI,CAAE,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAS3F,GAAG,IAAK,OAAO,CAAC,IAAI,CAAC;IAkC3B,OAAO,IAAK,IAAI;CAMjB"}
|
package/dist/src/queue/job.js
CHANGED
|
@@ -42,10 +42,10 @@ export class Job {
|
|
|
42
42
|
this.cleanup();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
async join(options
|
|
46
|
-
const recipient = new JobRecipient(options
|
|
45
|
+
async join(options) {
|
|
46
|
+
const recipient = new JobRecipient(options);
|
|
47
47
|
this.recipients.push(recipient);
|
|
48
|
-
options
|
|
48
|
+
options?.signal?.addEventListener('abort', this.onAbort);
|
|
49
49
|
return recipient.deferred.promise;
|
|
50
50
|
}
|
|
51
51
|
async run() {
|
|
@@ -55,7 +55,12 @@ export class Job {
|
|
|
55
55
|
this.controller.signal.throwIfAborted();
|
|
56
56
|
const result = await raceSignal(this.fn({
|
|
57
57
|
...(this.options ?? {}),
|
|
58
|
-
signal: this.controller.signal
|
|
58
|
+
signal: this.controller.signal,
|
|
59
|
+
onProgress: (evt) => {
|
|
60
|
+
this.recipients.forEach(recipient => {
|
|
61
|
+
recipient.onProgress?.(evt);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
59
64
|
}), this.controller.signal);
|
|
60
65
|
this.recipients.forEach(recipient => {
|
|
61
66
|
recipient.deferred.resolve(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;AACjF,CAAC;AAQD,MAAM,OAAO,GAAG;IACP,EAAE,CAAQ;IACV,EAAE,CAAiD;IACnD,OAAO,CAAY;IACnB,UAAU,CAAoC;IAC9C,MAAM,CAAW;IACR,QAAQ,CA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CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACnC,IAAI,CAAC,OAAO,EAAE,CAAA;QAChB,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAClC,SAAS,CAAC,OAAO,EAAE,CAAA;YACnB,SAAS,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { AbortOptions } from '@libp2p/interface';
|
|
1
2
|
import type { DeferredPromise } from 'p-defer';
|
|
2
|
-
|
|
3
|
+
import type { ProgressOptions, ProgressEventListener } from 'progress-events';
|
|
4
|
+
export declare class JobRecipient<JobReturnType, JobOptions extends AbortOptions & ProgressOptions = any> {
|
|
3
5
|
deferred: DeferredPromise<JobReturnType>;
|
|
4
6
|
signal?: AbortSignal;
|
|
5
|
-
|
|
7
|
+
onProgress?: ProgressEventListener;
|
|
8
|
+
constructor(options?: Partial<Pick<JobOptions, 'signal' | 'onProgress'>>);
|
|
6
9
|
onAbort(): void;
|
|
7
10
|
cleanup(): void;
|
|
8
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipient.d.ts","sourceRoot":"","sources":["../../../src/queue/recipient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"recipient.d.ts","sourceRoot":"","sources":["../../../src/queue/recipient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE7E,qBAAa,YAAY,CAAC,aAAa,EAAE,UAAU,SAAS,YAAY,GAAG,eAAe,GAAG,GAAG;IACvF,QAAQ,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IACxC,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,UAAU,CAAC,EAAE,qBAAqB,CAAA;gBAE5B,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;IASzE,OAAO,IAAK,IAAI;IAIhB,OAAO,IAAK,IAAI;CAGjB"}
|
|
@@ -3,8 +3,10 @@ import pDefer from 'p-defer';
|
|
|
3
3
|
export class JobRecipient {
|
|
4
4
|
deferred;
|
|
5
5
|
signal;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
onProgress;
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.signal = options?.signal;
|
|
9
|
+
this.onProgress = options?.onProgress;
|
|
8
10
|
this.deferred = pDefer();
|
|
9
11
|
this.onAbort = this.onAbort.bind(this);
|
|
10
12
|
this.signal?.addEventListener('abort', this.onAbort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipient.js","sourceRoot":"","sources":["../../../src/queue/recipient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,MAAM,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"recipient.js","sourceRoot":"","sources":["../../../src/queue/recipient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,MAAM,MAAM,SAAS,CAAA;AAK5B,MAAM,OAAO,YAAY;IAChB,QAAQ,CAAgC;IACxC,MAAM,CAAc;IACpB,UAAU,CAAwB;IAEzC,YAAa,OAA4D;QACvE,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAA;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,CAAA;QACrC,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,CAAA;QAExB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.15-b30baa93a",
|
|
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",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@chainsafe/is-ip": "^2.1.0",
|
|
48
48
|
"@chainsafe/netmask": "^2.0.0",
|
|
49
|
-
"@libp2p/crypto": "
|
|
50
|
-
"@libp2p/interface": "
|
|
51
|
-
"@libp2p/logger": "
|
|
49
|
+
"@libp2p/crypto": "5.1.15-b30baa93a",
|
|
50
|
+
"@libp2p/interface": "3.2.0-b30baa93a",
|
|
51
|
+
"@libp2p/logger": "6.2.4-b30baa93a",
|
|
52
52
|
"@multiformats/multiaddr": "^13.0.1",
|
|
53
53
|
"@sindresorhus/fnv1a": "^3.1.0",
|
|
54
54
|
"any-signal": "^4.1.1",
|
|
55
|
-
"cborg": "^
|
|
55
|
+
"cborg": "^5.1.0",
|
|
56
56
|
"delay": "^7.0.0",
|
|
57
57
|
"is-loopback-addr": "^2.0.2",
|
|
58
58
|
"it-length-prefixed": "^10.0.1",
|
|
@@ -63,13 +63,14 @@
|
|
|
63
63
|
"netmask": "^2.0.2",
|
|
64
64
|
"p-defer": "^4.0.1",
|
|
65
65
|
"p-event": "^7.0.0",
|
|
66
|
+
"progress-events": "^1.1.0",
|
|
66
67
|
"race-signal": "^2.0.0",
|
|
67
68
|
"uint8-varint": "^2.0.4",
|
|
68
69
|
"uint8arraylist": "^2.4.8",
|
|
69
70
|
"uint8arrays": "^5.1.0"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
|
-
"@libp2p/peer-id": "
|
|
73
|
+
"@libp2p/peer-id": "6.0.6-b30baa93a",
|
|
73
74
|
"@types/netmask": "^2.0.5",
|
|
74
75
|
"aegir": "^47.0.22",
|
|
75
76
|
"benchmark": "^2.1.4",
|
package/src/queue/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { debounce } from '../debounce.js'
|
|
|
6
6
|
import { QueueFullError } from '../errors.js'
|
|
7
7
|
import { Job } from './job.js'
|
|
8
8
|
import type { AbortOptions, Metrics } from '@libp2p/interface'
|
|
9
|
+
import type { ProgressOptions } from 'progress-events'
|
|
9
10
|
|
|
10
11
|
export type { Job, JobTimeline } from './job.js'
|
|
11
12
|
export type { JobRecipient } from './recipient.js'
|
|
@@ -118,7 +119,7 @@ export interface QueueEvents<JobReturnType, JobOptions extends AbortOptions = Ab
|
|
|
118
119
|
* 1. Items remain at the head of the queue while they are running so `queue.size` includes `queue.pending` items - this is so interested parties can join the results of a queue item while it is running
|
|
119
120
|
* 2. The options for a job are stored separately to the job in order for them to be modified while they are still in the queue
|
|
120
121
|
*/
|
|
121
|
-
export class Queue<JobReturnType = unknown, JobOptions extends AbortOptions = AbortOptions> extends TypedEventEmitter<QueueEvents<JobReturnType, JobOptions>> {
|
|
122
|
+
export class Queue<JobReturnType = unknown, JobOptions extends AbortOptions & ProgressOptions = AbortOptions> extends TypedEventEmitter<QueueEvents<JobReturnType, JobOptions>> {
|
|
122
123
|
public concurrency: number
|
|
123
124
|
public maxSize: number
|
|
124
125
|
public queue: Array<Job<JobOptions, JobReturnType>>
|
|
@@ -257,9 +258,8 @@ export class Queue<JobReturnType = unknown, JobOptions extends AbortOptions = Ab
|
|
|
257
258
|
const job = new Job<JobOptions, JobReturnType>(fn, options)
|
|
258
259
|
this.enqueue(job)
|
|
259
260
|
this.safeDispatchEvent('add')
|
|
260
|
-
this.tryToStartAnother()
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
const result = job.join(options)
|
|
263
263
|
.then(result => {
|
|
264
264
|
this.safeDispatchEvent('completed', { detail: result })
|
|
265
265
|
this.safeDispatchEvent('success', { detail: { job, result } })
|
|
@@ -281,6 +281,10 @@ export class Queue<JobReturnType = unknown, JobOptions extends AbortOptions = Ab
|
|
|
281
281
|
|
|
282
282
|
throw err
|
|
283
283
|
})
|
|
284
|
+
|
|
285
|
+
this.tryToStartAnother()
|
|
286
|
+
|
|
287
|
+
return result
|
|
284
288
|
}
|
|
285
289
|
|
|
286
290
|
/**
|
package/src/queue/job.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { raceSignal } from 'race-signal'
|
|
|
4
4
|
import { JobRecipient } from './recipient.js'
|
|
5
5
|
import type { JobStatus } from './index.js'
|
|
6
6
|
import type { AbortOptions } from '@libp2p/interface'
|
|
7
|
+
import type { ProgressOptions } from 'progress-events'
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Returns a random string
|
|
@@ -18,7 +19,7 @@ export interface JobTimeline {
|
|
|
18
19
|
finished?: number
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
export class Job <JobOptions extends AbortOptions = AbortOptions, JobReturnType = unknown> {
|
|
22
|
+
export class Job <JobOptions extends AbortOptions & ProgressOptions = AbortOptions, JobReturnType = unknown> {
|
|
22
23
|
public id: string
|
|
23
24
|
public fn: (options: JobOptions) => Promise<JobReturnType>
|
|
24
25
|
public options: JobOptions
|
|
@@ -59,11 +60,11 @@ export class Job <JobOptions extends AbortOptions = AbortOptions, JobReturnType
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
async join (options
|
|
63
|
-
const recipient = new JobRecipient<JobReturnType>(options
|
|
63
|
+
async join (options?: Partial<Pick<JobOptions, 'signal' | 'onProgress'>>): Promise<JobReturnType> {
|
|
64
|
+
const recipient = new JobRecipient<JobReturnType>(options)
|
|
64
65
|
this.recipients.push(recipient)
|
|
65
66
|
|
|
66
|
-
options
|
|
67
|
+
options?.signal?.addEventListener('abort', this.onAbort)
|
|
67
68
|
|
|
68
69
|
return recipient.deferred.promise
|
|
69
70
|
}
|
|
@@ -77,7 +78,12 @@ export class Job <JobOptions extends AbortOptions = AbortOptions, JobReturnType
|
|
|
77
78
|
|
|
78
79
|
const result = await raceSignal(this.fn({
|
|
79
80
|
...(this.options ?? {}),
|
|
80
|
-
signal: this.controller.signal
|
|
81
|
+
signal: this.controller.signal,
|
|
82
|
+
onProgress: (evt: any): void => {
|
|
83
|
+
this.recipients.forEach(recipient => {
|
|
84
|
+
recipient.onProgress?.(evt)
|
|
85
|
+
})
|
|
86
|
+
}
|
|
81
87
|
}), this.controller.signal)
|
|
82
88
|
|
|
83
89
|
this.recipients.forEach(recipient => {
|
package/src/queue/recipient.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { AbortError } from '@libp2p/interface'
|
|
2
2
|
import pDefer from 'p-defer'
|
|
3
|
+
import type { AbortOptions } from '@libp2p/interface'
|
|
3
4
|
import type { DeferredPromise } from 'p-defer'
|
|
5
|
+
import type { ProgressOptions, ProgressEventListener } from 'progress-events'
|
|
4
6
|
|
|
5
|
-
export class JobRecipient<JobReturnType> {
|
|
7
|
+
export class JobRecipient<JobReturnType, JobOptions extends AbortOptions & ProgressOptions = any> {
|
|
6
8
|
public deferred: DeferredPromise<JobReturnType>
|
|
7
9
|
public signal?: AbortSignal
|
|
10
|
+
public onProgress?: ProgressEventListener
|
|
8
11
|
|
|
9
|
-
constructor (
|
|
10
|
-
this.signal = signal
|
|
12
|
+
constructor (options?: Partial<Pick<JobOptions, 'signal' | 'onProgress'>>) {
|
|
13
|
+
this.signal = options?.signal
|
|
14
|
+
this.onProgress = options?.onProgress
|
|
11
15
|
this.deferred = pDefer()
|
|
12
16
|
|
|
13
17
|
this.onAbort = this.onAbort.bind(this)
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AbstractMessageStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractMessageStream.html",
|
|
3
|
-
"AbstractMultiaddrConnection": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractMultiaddrConnection.html",
|
|
4
|
-
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractStream.html",
|
|
5
|
-
"AbstractStreamMuxer": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractStreamMuxer.html",
|
|
6
|
-
"AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AdaptiveTimeout.html",
|
|
7
|
-
"BloomFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.BloomFilter.html",
|
|
8
|
-
"CuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.CuckooFilter.html",
|
|
9
|
-
"InvalidDataLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidDataLengthError.html",
|
|
10
|
-
"InvalidDataLengthLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidDataLengthLengthError.html",
|
|
11
|
-
"InvalidMessageLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidMessageLengthError.html",
|
|
12
|
-
"LengthPrefixedDecoder": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.LengthPrefixedDecoder.html",
|
|
13
|
-
"MaxEarlyStreamsError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MaxEarlyStreamsError.html",
|
|
14
|
-
"MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MemoryStorage.html",
|
|
15
|
-
"MockStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MockStream.html",
|
|
16
|
-
"MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MovingAverage.html",
|
|
17
|
-
"PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.PeerQueue.html",
|
|
18
|
-
"PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.PriorityQueue.html",
|
|
19
|
-
"Queue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.Queue.html",
|
|
20
|
-
"QueueFullError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.QueueFullError.html",
|
|
21
|
-
"RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.RateLimiter.html",
|
|
22
|
-
"RateLimitError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.RateLimitError.html",
|
|
23
|
-
"ScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.ScalableCuckooFilter.html",
|
|
24
|
-
"StreamClosedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.StreamClosedError.html",
|
|
25
|
-
"UnexpectedEOFError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.UnexpectedEOFError.html",
|
|
26
|
-
"UnwrappedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.UnwrappedError.html",
|
|
27
|
-
"AbstractMultiaddrConnectionInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractMultiaddrConnectionInit.html",
|
|
28
|
-
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractStreamInit.html",
|
|
29
|
-
"AbstractStreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractStreamMuxerInit.html",
|
|
30
|
-
"AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AdaptiveTimeoutInit.html",
|
|
31
|
-
"AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AdaptiveTimeoutSignal.html",
|
|
32
|
-
"BloomFilterOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.BloomFilterOptions.html",
|
|
33
|
-
"Bucket": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Bucket.html",
|
|
34
|
-
"ByteStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ByteStream.html",
|
|
35
|
-
"ByteStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ByteStreamOpts.html",
|
|
36
|
-
"Comparator": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Comparator.html",
|
|
37
|
-
"CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CreateTrackedListInit.html",
|
|
38
|
-
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CreateTrackedMapInit.html",
|
|
39
|
-
"CuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CuckooFilterInit.html",
|
|
40
|
-
"DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DebouncedFunction.html",
|
|
41
|
-
"DNS4NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNS4NetConfig.html",
|
|
42
|
-
"DNS6NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNS6NetConfig.html",
|
|
43
|
-
"DNSAddrNetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNSAddrNetConfig.html",
|
|
44
|
-
"DNSNetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNSNetConfig.html",
|
|
45
|
-
"Filter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Filter.html",
|
|
46
|
-
"Fingerprint": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Fingerprint.html",
|
|
47
|
-
"GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.GetKeySecDurationOptions.html",
|
|
48
|
-
"GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.GetTimeoutSignalOptions.html",
|
|
49
|
-
"Hash": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Hash.html",
|
|
50
|
-
"IP4NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.IP4NetConfig.html",
|
|
51
|
-
"IP6NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.IP6NetConfig.html",
|
|
52
|
-
"Job": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Job.html",
|
|
53
|
-
"JobMatcher": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobMatcher.html",
|
|
54
|
-
"JobRecipient": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobRecipient.html",
|
|
55
|
-
"JobTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobTimeline.html",
|
|
56
|
-
"LengthPrefixedDecoderInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedDecoderInit.html",
|
|
57
|
-
"LengthPrefixedStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedStream.html",
|
|
58
|
-
"LengthPrefixedStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedStreamOpts.html",
|
|
59
|
-
"MessageStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MessageStreamInit.html",
|
|
60
|
-
"MockMultiaddrConnectionInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MockMultiaddrConnectionInit.html",
|
|
61
|
-
"MockMuxedStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MockMuxedStreamInit.html",
|
|
62
|
-
"MultiaddrConnectionPairOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MultiaddrConnectionPairOptions.html",
|
|
63
|
-
"PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.PeerQueueJobOptions.html",
|
|
64
|
-
"PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.PriorityQueueJobOptions.html",
|
|
65
|
-
"ProtobufDecoder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufDecoder.html",
|
|
66
|
-
"ProtobufEncoder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufEncoder.html",
|
|
67
|
-
"ProtobufMessageStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufMessageStream.html",
|
|
68
|
-
"ProtobufStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufStream.html",
|
|
69
|
-
"ProtobufStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufStreamOpts.html",
|
|
70
|
-
"QueueEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueEvents.html",
|
|
71
|
-
"QueueInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueInit.html",
|
|
72
|
-
"QueueJobFailure": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueJobFailure.html",
|
|
73
|
-
"QueueJobSuccess": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueJobSuccess.html",
|
|
74
|
-
"RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateLimiterInit.html",
|
|
75
|
-
"RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateLimiterResult.html",
|
|
76
|
-
"RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateRecord.html",
|
|
77
|
-
"ReadBytesOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ReadBytesOptions.html",
|
|
78
|
-
"RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RepeatingTask.html",
|
|
79
|
-
"RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RepeatingTaskOptions.html",
|
|
80
|
-
"RunFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RunFunction.html",
|
|
81
|
-
"ScalableCuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ScalableCuckooFilterInit.html",
|
|
82
|
-
"SendResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.SendResult.html",
|
|
83
|
-
"StreamPairOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.StreamPairOptions.html",
|
|
84
|
-
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.TrackedMapInit.html",
|
|
85
|
-
"JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.JobStatus.html",
|
|
86
|
-
"NetConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.NetConfig.html",
|
|
87
|
-
"PipeInput": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.PipeInput.html",
|
|
88
|
-
"DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
89
|
-
"DEFAULT_INTERVAL": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_INTERVAL.html",
|
|
90
|
-
"DEFAULT_MAX_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_MAX_TIMEOUT.html",
|
|
91
|
-
"DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_MIN_TIMEOUT.html",
|
|
92
|
-
"DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
93
|
-
"byteStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.byteStream.html",
|
|
94
|
-
"createBloomFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createBloomFilter.html",
|
|
95
|
-
"createCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createCuckooFilter.html",
|
|
96
|
-
"createScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createScalableCuckooFilter.html",
|
|
97
|
-
"debounce": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.debounce.html",
|
|
98
|
-
"echo": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.echo.html",
|
|
99
|
-
"echoStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.echoStream.html",
|
|
100
|
-
"getNetConfig": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.getNetConfig.html",
|
|
101
|
-
"getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.getThinWaistAddresses.html",
|
|
102
|
-
"ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ipPortToMultiaddr.html",
|
|
103
|
-
"isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isAsyncGenerator.html",
|
|
104
|
-
"isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGenerator.html",
|
|
105
|
-
"isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGlobalUnicast.html",
|
|
106
|
-
"isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGlobalUnicastIp.html",
|
|
107
|
-
"isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLinkLocal.html",
|
|
108
|
-
"isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLinkLocalIp.html",
|
|
109
|
-
"isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLoopback.html",
|
|
110
|
-
"isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isNetworkAddress.html",
|
|
111
|
-
"isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPrivate.html",
|
|
112
|
-
"isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPrivateIp.html",
|
|
113
|
-
"isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPromise.html",
|
|
114
|
-
"lpStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.lpStream.html",
|
|
115
|
-
"messageStreamToDuplex": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.messageStreamToDuplex.html",
|
|
116
|
-
"mockMuxer": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.mockMuxer.html",
|
|
117
|
-
"multiaddrConnectionPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddrConnectionPair.html",
|
|
118
|
-
"pbStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.pbStream.html",
|
|
119
|
-
"pipe": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.pipe.html",
|
|
120
|
-
"repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeatingTask.html",
|
|
121
|
-
"streamPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.streamPair.html",
|
|
122
|
-
"trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.trackedList.html",
|
|
123
|
-
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.trackedMap.html"
|
|
124
|
-
}
|