@fluidframework/driver-utils 2.0.0-dev.7.4.0.216897 → 2.0.0-dev.7.4.0.217884

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.
@@ -320,7 +320,7 @@ export class Queue<T> implements IStream<T> {
320
320
  read(): Promise<IStreamResult<T>>;
321
321
  }
322
322
 
323
- // @internal (undocumented)
323
+ // @alpha (undocumented)
324
324
  export class RateLimiter {
325
325
  constructor(maxRequests: number);
326
326
  // (undocumented)
@@ -1,16 +1,31 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
2
3
  import { IBlob } from '@fluidframework/protocol-definitions';
3
4
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
5
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
6
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
7
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
9
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
10
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
11
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
12
+ import { IRequest } from '@fluidframework/core-interfaces';
13
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
14
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
15
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
16
+ import { IStream } from '@fluidframework/driver-definitions';
17
+ import { IStreamResult } from '@fluidframework/driver-definitions';
18
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
19
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
22
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
23
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
11
24
  import { ITree } from '@fluidframework/protocol-definitions';
12
25
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
26
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
27
  import { IVersion } from '@fluidframework/protocol-definitions';
28
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
14
29
 
15
30
  /* Excluded from this release type: applyStorageCompression */
16
31
 
@@ -46,8 +61,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
46
61
 
47
62
  /* Excluded from this release type: emptyMessageStream */
48
63
 
49
- /* Excluded from this release type: FetchSource */
50
-
51
64
  /* Excluded from this release type: FluidInvalidSchemaError */
52
65
 
53
66
  /* Excluded from this release type: GenericNetworkError */
@@ -66,14 +79,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
66
79
 
67
80
  /* Excluded from this release type: IDeltasFetchResult */
68
81
 
69
- /* Excluded from this release type: IDocumentServiceFactory */
70
-
71
- /* Excluded from this release type: IDocumentStorageService */
72
-
73
- /* Excluded from this release type: IDocumentStorageServicePolicies */
74
-
75
- /* Excluded from this release type: IDriverErrorBase */
76
-
77
82
  /* Excluded from this release type: IFluidErrorBase */
78
83
 
79
84
  /* Excluded from this release type: ILocationRedirectionError */
@@ -82,34 +87,14 @@ import { IVersion } from '@fluidframework/protocol-definitions';
82
87
 
83
88
  /* Excluded from this release type: IProgress */
84
89
 
85
- /* Excluded from this release type: IRequest */
86
-
87
- /* Excluded from this release type: IResolvedUrl */
88
-
89
90
  /* Excluded from this release type: isCombinedAppAndProtocolSummary */
90
91
 
91
92
  /* Excluded from this release type: isOnline */
92
93
 
93
94
  /* Excluded from this release type: isRuntimeMessage */
94
95
 
95
- /* Excluded from this release type: IStream */
96
-
97
- /* Excluded from this release type: IStreamResult */
98
-
99
- /* Excluded from this release type: ISummaryContext */
100
-
101
- /* Excluded from this release type: ITelemetryErrorEvent */
102
-
103
- /* Excluded from this release type: ITelemetryLoggerExt */
104
-
105
- /* Excluded from this release type: ITelemetryProperties */
106
-
107
96
  /* Excluded from this release type: IThrottlingWarning */
108
97
 
109
- /* Excluded from this release type: IUrlResolver */
110
-
111
- /* Excluded from this release type: LoaderCachingPolicy */
112
-
113
98
  /* Excluded from this release type: LocationRedirectionError */
114
99
 
115
100
  /* Excluded from this release type: LoggingError */
@@ -130,7 +115,18 @@ import { IVersion } from '@fluidframework/protocol-definitions';
130
115
 
131
116
  /* Excluded from this release type: Queue */
132
117
 
133
- /* Excluded from this release type: RateLimiter */
118
+ /**
119
+ * @alpha
120
+ */
121
+ export declare class RateLimiter {
122
+ private maxRequests;
123
+ private readonly tasks;
124
+ constructor(maxRequests: number);
125
+ get waitQueueLength(): number;
126
+ protected readonly release: () => void;
127
+ protected acquire(): Promise<void>;
128
+ schedule<T>(work: () => Promise<T>): Promise<T>;
129
+ }
134
130
 
135
131
  /* Excluded from this release type: readAndParse */
136
132
 
@@ -476,7 +476,7 @@ export declare class Queue<T> implements IStream<T> {
476
476
  }
477
477
 
478
478
  /**
479
- * @internal
479
+ * @alpha
480
480
  */
481
481
  export declare class RateLimiter {
482
482
  private maxRequests;
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-utils";
8
- export declare const pkgVersion = "2.0.0-dev.7.4.0.216897";
8
+ export declare const pkgVersion = "2.0.0-dev.7.4.0.217884";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/driver-utils";
11
- exports.pkgVersion = "2.0.0-dev.7.4.0.216897";
11
+ exports.pkgVersion = "2.0.0-dev.7.4.0.217884";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.216897\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.217884\";\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare class RateLimiter {
9
9
  private maxRequests;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.RateLimiter = void 0;
8
8
  const core_utils_1 = require("@fluidframework/core-utils");
9
9
  /**
10
- * @internal
10
+ * @alpha
11
11
  */
12
12
  class RateLimiter {
13
13
  constructor(maxRequests) {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;GAEG;AACH,MAAa,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,mBAAM,EAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD;AAnCD,kCAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * @internal\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
1
+ {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;GAEG;AACH,MAAa,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,mBAAM,EAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD;AAnCD,kCAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
@@ -1,16 +1,31 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
2
3
  import { IBlob } from '@fluidframework/protocol-definitions';
3
4
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
5
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
6
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
7
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
9
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
10
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
11
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
12
+ import { IRequest } from '@fluidframework/core-interfaces';
13
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
14
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
15
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
16
+ import { IStream } from '@fluidframework/driver-definitions';
17
+ import { IStreamResult } from '@fluidframework/driver-definitions';
18
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
19
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
22
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
23
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
11
24
  import { ITree } from '@fluidframework/protocol-definitions';
12
25
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
26
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
27
  import { IVersion } from '@fluidframework/protocol-definitions';
28
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
14
29
 
15
30
  /* Excluded from this release type: applyStorageCompression */
16
31
 
@@ -46,8 +61,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
46
61
 
47
62
  /* Excluded from this release type: emptyMessageStream */
48
63
 
49
- /* Excluded from this release type: FetchSource */
50
-
51
64
  /* Excluded from this release type: FluidInvalidSchemaError */
52
65
 
53
66
  /* Excluded from this release type: GenericNetworkError */
@@ -66,14 +79,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
66
79
 
67
80
  /* Excluded from this release type: IDeltasFetchResult */
68
81
 
69
- /* Excluded from this release type: IDocumentServiceFactory */
70
-
71
- /* Excluded from this release type: IDocumentStorageService */
72
-
73
- /* Excluded from this release type: IDocumentStorageServicePolicies */
74
-
75
- /* Excluded from this release type: IDriverErrorBase */
76
-
77
82
  /* Excluded from this release type: IFluidErrorBase */
78
83
 
79
84
  /* Excluded from this release type: ILocationRedirectionError */
@@ -82,34 +87,14 @@ import { IVersion } from '@fluidframework/protocol-definitions';
82
87
 
83
88
  /* Excluded from this release type: IProgress */
84
89
 
85
- /* Excluded from this release type: IRequest */
86
-
87
- /* Excluded from this release type: IResolvedUrl */
88
-
89
90
  /* Excluded from this release type: isCombinedAppAndProtocolSummary */
90
91
 
91
92
  /* Excluded from this release type: isOnline */
92
93
 
93
94
  /* Excluded from this release type: isRuntimeMessage */
94
95
 
95
- /* Excluded from this release type: IStream */
96
-
97
- /* Excluded from this release type: IStreamResult */
98
-
99
- /* Excluded from this release type: ISummaryContext */
100
-
101
- /* Excluded from this release type: ITelemetryErrorEvent */
102
-
103
- /* Excluded from this release type: ITelemetryLoggerExt */
104
-
105
- /* Excluded from this release type: ITelemetryProperties */
106
-
107
96
  /* Excluded from this release type: IThrottlingWarning */
108
97
 
109
- /* Excluded from this release type: IUrlResolver */
110
-
111
- /* Excluded from this release type: LoaderCachingPolicy */
112
-
113
98
  /* Excluded from this release type: LocationRedirectionError */
114
99
 
115
100
  /* Excluded from this release type: LoggingError */
@@ -130,7 +115,18 @@ import { IVersion } from '@fluidframework/protocol-definitions';
130
115
 
131
116
  /* Excluded from this release type: Queue */
132
117
 
133
- /* Excluded from this release type: RateLimiter */
118
+ /**
119
+ * @alpha
120
+ */
121
+ export declare class RateLimiter {
122
+ private maxRequests;
123
+ private readonly tasks;
124
+ constructor(maxRequests: number);
125
+ get waitQueueLength(): number;
126
+ protected readonly release: () => void;
127
+ protected acquire(): Promise<void>;
128
+ schedule<T>(work: () => Promise<T>): Promise<T>;
129
+ }
134
130
 
135
131
  /* Excluded from this release type: readAndParse */
136
132
 
@@ -476,7 +476,7 @@ export declare class Queue<T> implements IStream<T> {
476
476
  }
477
477
 
478
478
  /**
479
- * @internal
479
+ * @alpha
480
480
  */
481
481
  export declare class RateLimiter {
482
482
  private maxRequests;
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-utils";
8
- export declare const pkgVersion = "2.0.0-dev.7.4.0.216897";
8
+ export declare const pkgVersion = "2.0.0-dev.7.4.0.217884";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-utils";
8
- export const pkgVersion = "2.0.0-dev.7.4.0.216897";
8
+ export const pkgVersion = "2.0.0-dev.7.4.0.217884";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.216897\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.217884\";\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare class RateLimiter {
9
9
  private maxRequests;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { assert } from "@fluidframework/core-utils";
6
6
  /**
7
- * @internal
7
+ * @alpha
8
8
  */
9
9
  export class RateLimiter {
10
10
  constructor(maxRequests) {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * @internal\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
1
+ {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-utils",
3
- "version": "2.0.0-dev.7.4.0.216897",
3
+ "version": "2.0.0-dev.7.4.0.217884",
4
4
  "description": "Collection of utility functions for Fluid drivers",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,14 +35,14 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.216897",
39
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.216897",
40
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.216897",
41
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.216897",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.217884",
39
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217884",
40
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.217884",
41
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.217884",
42
42
  "@fluidframework/gitresources": "^2.0.1",
43
43
  "@fluidframework/protocol-base": "^2.0.1",
44
44
  "@fluidframework/protocol-definitions": "^3.0.0",
45
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.216897",
45
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.217884",
46
46
  "axios": "^0.26.0",
47
47
  "lz4js": "^0.2.0",
48
48
  "url": "^0.11.0",
@@ -54,10 +54,10 @@
54
54
  "@fluidframework/build-tools": "^0.28.0",
55
55
  "@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.7.2.0",
56
56
  "@fluidframework/eslint-config-fluid": "^3.1.0",
57
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.216897",
57
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217884",
58
58
  "@microsoft/api-extractor": "^7.38.3",
59
59
  "@types/mocha": "^9.1.1",
60
- "@types/node": "^16.18.38",
60
+ "@types/node": "^18.19.0",
61
61
  "@types/sinon": "^7.0.13",
62
62
  "c8": "^7.7.1",
63
63
  "copyfiles": "^2.4.1",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-utils";
9
- export const pkgVersion = "2.0.0-dev.7.4.0.216897";
9
+ export const pkgVersion = "2.0.0-dev.7.4.0.217884";
@@ -6,7 +6,7 @@
6
6
  import { assert } from "@fluidframework/core-utils";
7
7
 
8
8
  /**
9
- * @internal
9
+ * @alpha
10
10
  */
11
11
  export class RateLimiter {
12
12
  private readonly tasks: (() => void)[] = [];