@fluidframework/container-loader 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258

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.
Files changed (204) hide show
  1. package/CHANGELOG.md +162 -0
  2. package/README.md +10 -6
  3. package/dist/audience.d.ts +1 -0
  4. package/dist/audience.d.ts.map +1 -1
  5. package/dist/audience.js +5 -3
  6. package/dist/audience.js.map +1 -1
  7. package/dist/catchUpMonitor.d.ts +1 -1
  8. package/dist/catchUpMonitor.d.ts.map +1 -1
  9. package/dist/catchUpMonitor.js +2 -2
  10. package/dist/catchUpMonitor.js.map +1 -1
  11. package/dist/connectionManager.d.ts +6 -6
  12. package/dist/connectionManager.d.ts.map +1 -1
  13. package/dist/connectionManager.js +97 -93
  14. package/dist/connectionManager.js.map +1 -1
  15. package/dist/connectionStateHandler.d.ts +19 -15
  16. package/dist/connectionStateHandler.d.ts.map +1 -1
  17. package/dist/connectionStateHandler.js +59 -59
  18. package/dist/connectionStateHandler.js.map +1 -1
  19. package/dist/container.d.ts +48 -38
  20. package/dist/container.d.ts.map +1 -1
  21. package/dist/container.js +447 -325
  22. package/dist/container.js.map +1 -1
  23. package/dist/containerContext.d.ts +22 -70
  24. package/dist/containerContext.d.ts.map +1 -1
  25. package/dist/containerContext.js +24 -221
  26. package/dist/containerContext.js.map +1 -1
  27. package/dist/containerStorageAdapter.d.ts +1 -1
  28. package/dist/containerStorageAdapter.d.ts.map +1 -1
  29. package/dist/containerStorageAdapter.js +47 -16
  30. package/dist/containerStorageAdapter.js.map +1 -1
  31. package/dist/contracts.d.ts +21 -10
  32. package/dist/contracts.d.ts.map +1 -1
  33. package/dist/contracts.js +3 -3
  34. package/dist/contracts.js.map +1 -1
  35. package/dist/debugLogger.d.ts +30 -0
  36. package/dist/debugLogger.d.ts.map +1 -0
  37. package/dist/debugLogger.js +95 -0
  38. package/dist/debugLogger.js.map +1 -0
  39. package/dist/deltaManager.d.ts +21 -9
  40. package/dist/deltaManager.d.ts.map +1 -1
  41. package/dist/deltaManager.js +114 -66
  42. package/dist/deltaManager.js.map +1 -1
  43. package/dist/deltaQueue.d.ts +1 -1
  44. package/dist/deltaQueue.d.ts.map +1 -1
  45. package/dist/deltaQueue.js +10 -10
  46. package/dist/deltaQueue.js.map +1 -1
  47. package/dist/disposal.d.ts +13 -0
  48. package/dist/disposal.d.ts.map +1 -0
  49. package/dist/disposal.js +25 -0
  50. package/dist/disposal.js.map +1 -0
  51. package/dist/error.d.ts +23 -0
  52. package/dist/error.d.ts.map +1 -0
  53. package/dist/error.js +32 -0
  54. package/dist/error.js.map +1 -0
  55. package/dist/loader.d.ts +23 -5
  56. package/dist/loader.d.ts.map +1 -1
  57. package/dist/loader.js +82 -51
  58. package/dist/loader.js.map +1 -1
  59. package/dist/noopHeuristic.d.ts +23 -0
  60. package/dist/noopHeuristic.d.ts.map +1 -0
  61. package/dist/noopHeuristic.js +90 -0
  62. package/dist/noopHeuristic.js.map +1 -0
  63. package/dist/packageVersion.d.ts +1 -1
  64. package/dist/packageVersion.js +1 -1
  65. package/dist/packageVersion.js.map +1 -1
  66. package/dist/protocol.d.ts +9 -12
  67. package/dist/protocol.d.ts.map +1 -1
  68. package/dist/protocol.js +26 -7
  69. package/dist/protocol.js.map +1 -1
  70. package/dist/protocolTreeDocumentStorageService.d.ts +1 -1
  71. package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
  72. package/dist/protocolTreeDocumentStorageService.js.map +1 -1
  73. package/dist/quorum.d.ts +1 -14
  74. package/dist/quorum.d.ts.map +1 -1
  75. package/dist/quorum.js +1 -29
  76. package/dist/quorum.js.map +1 -1
  77. package/dist/retriableDocumentStorageService.d.ts +1 -1
  78. package/dist/retriableDocumentStorageService.d.ts.map +1 -1
  79. package/dist/retriableDocumentStorageService.js +4 -4
  80. package/dist/retriableDocumentStorageService.js.map +1 -1
  81. package/dist/utils.d.ts +8 -1
  82. package/dist/utils.d.ts.map +1 -1
  83. package/dist/utils.js +30 -11
  84. package/dist/utils.js.map +1 -1
  85. package/lib/audience.d.ts +1 -0
  86. package/lib/audience.d.ts.map +1 -1
  87. package/lib/audience.js +4 -2
  88. package/lib/audience.js.map +1 -1
  89. package/lib/catchUpMonitor.d.ts +1 -1
  90. package/lib/catchUpMonitor.d.ts.map +1 -1
  91. package/lib/catchUpMonitor.js +1 -1
  92. package/lib/catchUpMonitor.js.map +1 -1
  93. package/lib/connectionManager.d.ts +6 -6
  94. package/lib/connectionManager.d.ts.map +1 -1
  95. package/lib/connectionManager.js +74 -67
  96. package/lib/connectionManager.js.map +1 -1
  97. package/lib/connectionStateHandler.d.ts +19 -15
  98. package/lib/connectionStateHandler.d.ts.map +1 -1
  99. package/lib/connectionStateHandler.js +36 -36
  100. package/lib/connectionStateHandler.js.map +1 -1
  101. package/lib/container.d.ts +48 -38
  102. package/lib/container.d.ts.map +1 -1
  103. package/lib/container.js +414 -292
  104. package/lib/container.js.map +1 -1
  105. package/lib/containerContext.d.ts +22 -70
  106. package/lib/containerContext.d.ts.map +1 -1
  107. package/lib/containerContext.js +24 -221
  108. package/lib/containerContext.js.map +1 -1
  109. package/lib/containerStorageAdapter.d.ts +1 -1
  110. package/lib/containerStorageAdapter.d.ts.map +1 -1
  111. package/lib/containerStorageAdapter.js +43 -12
  112. package/lib/containerStorageAdapter.js.map +1 -1
  113. package/lib/contracts.d.ts +21 -10
  114. package/lib/contracts.d.ts.map +1 -1
  115. package/lib/contracts.js +3 -3
  116. package/lib/contracts.js.map +1 -1
  117. package/lib/debugLogger.d.ts +30 -0
  118. package/lib/debugLogger.d.ts.map +1 -0
  119. package/lib/debugLogger.js +91 -0
  120. package/lib/debugLogger.js.map +1 -0
  121. package/lib/deltaManager.d.ts +21 -9
  122. package/lib/deltaManager.d.ts.map +1 -1
  123. package/lib/deltaManager.js +88 -37
  124. package/lib/deltaManager.js.map +1 -1
  125. package/lib/deltaQueue.d.ts +1 -1
  126. package/lib/deltaQueue.d.ts.map +1 -1
  127. package/lib/deltaQueue.js +3 -3
  128. package/lib/deltaQueue.js.map +1 -1
  129. package/lib/disposal.d.ts +13 -0
  130. package/lib/disposal.d.ts.map +1 -0
  131. package/lib/disposal.js +21 -0
  132. package/lib/disposal.js.map +1 -0
  133. package/lib/error.d.ts +23 -0
  134. package/lib/error.d.ts.map +1 -0
  135. package/lib/error.js +28 -0
  136. package/lib/error.js.map +1 -0
  137. package/lib/loader.d.ts +23 -5
  138. package/lib/loader.d.ts.map +1 -1
  139. package/lib/loader.js +82 -51
  140. package/lib/loader.js.map +1 -1
  141. package/lib/noopHeuristic.d.ts +23 -0
  142. package/lib/noopHeuristic.d.ts.map +1 -0
  143. package/lib/{collabWindowTracker.js → noopHeuristic.js} +31 -42
  144. package/lib/noopHeuristic.js.map +1 -0
  145. package/lib/packageVersion.d.ts +1 -1
  146. package/lib/packageVersion.js +1 -1
  147. package/lib/packageVersion.js.map +1 -1
  148. package/lib/protocol.d.ts +9 -12
  149. package/lib/protocol.d.ts.map +1 -1
  150. package/lib/protocol.js +24 -6
  151. package/lib/protocol.js.map +1 -1
  152. package/lib/protocolTreeDocumentStorageService.d.ts +1 -1
  153. package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
  154. package/lib/protocolTreeDocumentStorageService.js.map +1 -1
  155. package/lib/quorum.d.ts +1 -14
  156. package/lib/quorum.d.ts.map +1 -1
  157. package/lib/quorum.js +0 -26
  158. package/lib/quorum.js.map +1 -1
  159. package/lib/retriableDocumentStorageService.d.ts +1 -1
  160. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  161. package/lib/retriableDocumentStorageService.js +2 -2
  162. package/lib/retriableDocumentStorageService.js.map +1 -1
  163. package/lib/utils.d.ts +8 -1
  164. package/lib/utils.d.ts.map +1 -1
  165. package/lib/utils.js +25 -7
  166. package/lib/utils.js.map +1 -1
  167. package/package.json +26 -28
  168. package/src/audience.ts +7 -1
  169. package/src/catchUpMonitor.ts +2 -2
  170. package/src/connectionManager.ts +76 -52
  171. package/src/connectionStateHandler.ts +46 -48
  172. package/src/container.ts +561 -326
  173. package/src/containerContext.ts +31 -349
  174. package/src/containerStorageAdapter.ts +49 -6
  175. package/src/contracts.ts +27 -13
  176. package/src/debugLogger.ts +113 -0
  177. package/src/deltaManager.ts +93 -36
  178. package/src/deltaQueue.ts +2 -1
  179. package/src/disposal.ts +25 -0
  180. package/src/error.ts +44 -0
  181. package/src/loader.ts +84 -36
  182. package/src/{collabWindowTracker.ts → noopHeuristic.ts} +38 -47
  183. package/src/packageVersion.ts +1 -1
  184. package/src/protocol.ts +26 -16
  185. package/src/protocolTreeDocumentStorageService.ts +1 -1
  186. package/src/quorum.ts +1 -40
  187. package/src/retriableDocumentStorageService.ts +3 -4
  188. package/src/utils.ts +33 -8
  189. package/dist/collabWindowTracker.d.ts +0 -19
  190. package/dist/collabWindowTracker.d.ts.map +0 -1
  191. package/dist/collabWindowTracker.js +0 -101
  192. package/dist/collabWindowTracker.js.map +0 -1
  193. package/dist/deltaManagerProxy.d.ts +0 -42
  194. package/dist/deltaManagerProxy.d.ts.map +0 -1
  195. package/dist/deltaManagerProxy.js +0 -79
  196. package/dist/deltaManagerProxy.js.map +0 -1
  197. package/lib/collabWindowTracker.d.ts +0 -19
  198. package/lib/collabWindowTracker.d.ts.map +0 -1
  199. package/lib/collabWindowTracker.js.map +0 -1
  200. package/lib/deltaManagerProxy.d.ts +0 -42
  201. package/lib/deltaManagerProxy.d.ts.map +0 -1
  202. package/lib/deltaManagerProxy.js +0 -74
  203. package/lib/deltaManagerProxy.js.map +0 -1
  204. package/src/deltaManagerProxy.ts +0 -109
@@ -1,101 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.CollabWindowTracker = void 0;
8
- const common_utils_1 = require("@fluidframework/common-utils");
9
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
10
- const driver_utils_1 = require("@fluidframework/driver-utils");
11
- const defaultNoopTimeFrequency = 2000;
12
- const defaultNoopCountFrequency = 50;
13
- // Here are key considerations when deciding conditions for when to send non-immediate noops:
14
- // 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance
15
- // 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have
16
- // large catchUp blobs - see Issue #6364
17
- // 3. Similarly, processes that rely on "core" snapshot (and can't parse trailing ops, including above), like search
18
- // parser in SPO, will result in non-accurate results due to presence of catch up blobs.
19
- // 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more
20
- // aggressive noop sending from client side.
21
- // 5. Number of ops sent by all clients is proportional to number of "write" clients (every client sends noops),
22
- // but number of sequenced noops is a function of time (one op per 2 seconds at most).
23
- // We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.
24
- // Please also see Issue #5629 for more discussions.
25
- //
26
- // With that, the current algorithm is as follows:
27
- // 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.
28
- // This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,
29
- // server timeout of 2000ms should be reconsidered to be increased.
30
- // 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.
31
- // Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.
32
- class CollabWindowTracker {
33
- constructor(submit, NoopTimeFrequency = defaultNoopTimeFrequency, NoopCountFrequency = defaultNoopCountFrequency) {
34
- this.submit = submit;
35
- this.NoopCountFrequency = NoopCountFrequency;
36
- this.opsCountSinceNoop = 0;
37
- if (NoopTimeFrequency !== Infinity) {
38
- this.timer = new common_utils_1.Timer(NoopTimeFrequency, () => {
39
- // Can get here due to this.stopSequenceNumberUpdate() not resetting timer.
40
- // Also timer callback can fire even after timer cancellation if it was queued before cancellation.
41
- if (this.opsCountSinceNoop !== 0) {
42
- this.submitNoop(false /* immediate */);
43
- }
44
- });
45
- }
46
- }
47
- /**
48
- * Schedules as ack to the server to update the reference sequence number
49
- */
50
- scheduleSequenceNumberUpdate(message, immediateNoOp) {
51
- // While processing a message, an immediate no-op can be requested.
52
- // i.e. to expedite approve or commit phase of quorum.
53
- if (immediateNoOp) {
54
- this.submitNoop(true /* immediate */);
55
- return;
56
- }
57
- // We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN
58
- // update, which updates the MSN, then ack the update, etc...).
59
- // Intent here is for runtime (and DDSes) not to keep too much tracking state / memory
60
- // due to runtime ops from other clients.
61
- if (!(0, driver_utils_1.isRuntimeMessage)(message)) {
62
- return;
63
- }
64
- this.opsCountSinceNoop++;
65
- if (this.opsCountSinceNoop === this.NoopCountFrequency) {
66
- // Ensure we only send noop after a batch of many ops is processed
67
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
68
- Promise.resolve().then(() => {
69
- if (this.opsCountSinceNoop >= this.NoopCountFrequency) {
70
- this.submitNoop(false /* immediate */);
71
- // reset count now that all ops are processed
72
- this.opsCountSinceNoop = 0;
73
- }
74
- return;
75
- });
76
- }
77
- if (this.timer !== undefined) {
78
- if (this.opsCountSinceNoop === 1) {
79
- this.timer.restart();
80
- }
81
- (0, common_utils_1.assert)(this.timer.hasTimer, 0x242 /* "has timer" */);
82
- }
83
- }
84
- submitNoop(immediate) {
85
- // Anything other than null is immediate noop
86
- // ADO:1385: Remove cast and use MessageType once definition changes propagate
87
- this.submit(immediate ? driver_utils_1.MessageType2.Accept : protocol_definitions_1.MessageType.NoOp);
88
- (0, common_utils_1.assert)(this.opsCountSinceNoop === 0, 0x243 /* "stopSequenceNumberUpdate should be called as result of sending any op!" */);
89
- }
90
- stopSequenceNumberUpdate() {
91
- this.opsCountSinceNoop = 0;
92
- // Ideally, we cancel timer here. But that will result in too often set/reset cycle if this client
93
- // keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)
94
- // for nothing, then have a ton of set/reset cycles.
95
- // Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer
96
- // expiration - it will restart the timer instead when it fires with adjusted expiration.
97
- // this.timer.clear();
98
- }
99
- }
100
- exports.CollabWindowTracker = CollabWindowTracker;
101
- //# sourceMappingURL=collabWindowTracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collabWindowTracker.js","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA6D;AAC7D,+EAA8F;AAC9F,+DAA8E;AAE9E,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC,6FAA6F;AAC7F,4GAA4G;AAC5G,yGAAyG;AACzG,2CAA2C;AAC3C,oHAAoH;AACpH,2FAA2F;AAC3F,kHAAkH;AAClH,+CAA+C;AAC/C,gHAAgH;AAChH,yFAAyF;AACzF,qHAAqH;AACrH,oDAAoD;AACpD,EAAE;AACF,kDAAkD;AAClD,oGAAoG;AACpG,iHAAiH;AACjH,sEAAsE;AACtE,4GAA4G;AAC5G,qGAAqG;AACrG,MAAa,mBAAmB;IAI/B,YACkB,MAAmC,EACpD,oBAA4B,wBAAwB,EACnC,qBAA6B,yBAAyB;QAFtD,WAAM,GAAN,MAAM,CAA6B;QAEnC,uBAAkB,GAAlB,kBAAkB,CAAoC;QANhE,sBAAiB,GAAG,CAAC,CAAC;QAQ7B,IAAI,iBAAiB,KAAK,QAAQ,EAAE;YACnC,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE;gBAC9C,2EAA2E;gBAC3E,mGAAmG;gBACnG,IAAI,IAAI,CAAC,iBAAiB,KAAK,CAAC,EAAE;oBACjC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;iBACvC;YACF,CAAC,CAAC,CAAC;SACH;IACF,CAAC;IAED;;OAEG;IACI,4BAA4B,CAClC,OAAkC,EAClC,aAAsB;QAEtB,mEAAmE;QACnE,sDAAsD;QACtD,IAAI,aAAa,EAAE;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iB,GAAG,CAAC,CAAC;QAC3B,kGAAkG;QAClG,wGAAwG;QACxG,oDAAoD;QACpD,qGAAqG;QACrG,yFAAyF;QACzF,sBAAsB;IACvB,CAAC;CACD;AApFD,kDAoFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { isRuntimeMessage, MessageType2 } from \"@fluidframework/driver-utils\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class CollabWindowTracker {\n\tprivate opsCountSinceNoop = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tprivate readonly submit: (type: MessageType) => void,\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tif (NoopTimeFrequency !== Infinity) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// Can get here due to this.stopSequenceNumberUpdate() not resetting timer.\n\t\t\t\t// Also timer callback can fire even after timer cancellation if it was queued before cancellation.\n\t\t\t\tif (this.opsCountSinceNoop !== 0) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic scheduleSequenceNumberUpdate(\n\t\tmessage: ISequencedDocumentMessage,\n\t\timmediateNoOp: boolean,\n\t): void {\n\t\t// While processing a message, an immediate no-op can be requested.\n\t\t// i.e. to expedite approve or commit phase of quorum.\n\t\tif (immediateNoOp) {\n\t\t\tthis.submitNoop(true /* immediate */);\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsCountSinceNoop++;\n\t\tif (this.opsCountSinceNoop === this.NoopCountFrequency) {\n\t\t\t// Ensure we only send noop after a batch of many ops is processed\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (this.opsCountSinceNoop >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t\t// reset count now that all ops are processed\n\t\t\t\t\tthis.opsCountSinceNoop = 0;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\tif (this.opsCountSinceNoop === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tprivate submitNoop(immediate: boolean) {\n\t\t// Anything other than null is immediate noop\n\t\t// ADO:1385: Remove cast and use MessageType once definition changes propagate\n\t\tthis.submit(immediate ? (MessageType2.Accept as unknown as MessageType) : MessageType.NoOp);\n\t\tassert(\n\t\t\tthis.opsCountSinceNoop === 0,\n\t\t\t0x243 /* \"stopSequenceNumberUpdate should be called as result of sending any op!\" */,\n\t\t);\n\t}\n\n\tpublic stopSequenceNumberUpdate(): void {\n\t\tthis.opsCountSinceNoop = 0;\n\t\t// Ideally, we cancel timer here. But that will result in too often set/reset cycle if this client\n\t\t// keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)\n\t\t// for nothing, then have a ton of set/reset cycles.\n\t\t// Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer\n\t\t// expiration - it will restart the timer instead when it fires with adjusted expiration.\n\t\t// this.timer.clear();\n\t}\n}\n"]}
@@ -1,42 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IDeltaManager, IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
6
- import { EventForwarder } from "@fluidframework/common-utils";
7
- import { IDocumentMessage, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/protocol-definitions";
8
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
9
- /**
10
- * Proxy to the real IDeltaQueue - used to restrict access
11
- */
12
- export declare class DeltaQueueProxy<T> extends EventForwarder<IDeltaQueueEvents<T>> implements IDeltaQueue<T> {
13
- private readonly queue;
14
- get paused(): boolean;
15
- get length(): number;
16
- get idle(): boolean;
17
- constructor(queue: IDeltaQueue<T>);
18
- peek(): T | undefined;
19
- toArray(): T[];
20
- systemPause(): Promise<void>;
21
- pause(): Promise<void>;
22
- systemResume(): Promise<void>;
23
- resume(): Promise<void>;
24
- waitTillProcessingDone(): Promise<{
25
- count: number;
26
- duration: number;
27
- }>;
28
- }
29
- /**
30
- * Proxy to the real IDeltaManager - used to restrict access
31
- */
32
- export declare class DeltaManagerProxy extends DeltaManagerProxyBase implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
33
- get inbound(): IDeltaQueue<ISequencedDocumentMessage>;
34
- private readonly _inbound;
35
- get outbound(): IDeltaQueue<IDocumentMessage[]>;
36
- private readonly _outbound;
37
- get inboundSignal(): IDeltaQueue<ISignalMessage>;
38
- private readonly _inboundSignal;
39
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
40
- dispose(): void;
41
- }
42
- //# sourceMappingURL=deltaManagerProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deltaManagerProxy.d.ts","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAC7B,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC3C,YAAW,WAAW,CAAC,CAAC,CAAC;IAcb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAZlC,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,IAAI,IAAI,OAAO,CAEzB;gBAE4B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAI3C,IAAI,IAAI,CAAC,GAAG,SAAS;IAIrB,OAAO,IAAI,CAAC,EAAE;IAKR,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,sBAAsB;;;;CAGnC;AAED;;GAEG;AACH,qBAAa,iBACZ,SAAQ,qBACR,YAAW,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAErE,IAAW,OAAO,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAE3D;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAElE,IAAW,QAAQ,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAErD;IACD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAE5D,IAAW,aAAa,IAAI,WAAW,CAAC,cAAc,CAAC,CAEtD;IACD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;gBAEjD,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAQ7E,OAAO,IAAI,IAAI;CAMtB"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DeltaManagerProxy = exports.DeltaQueueProxy = void 0;
8
- const common_utils_1 = require("@fluidframework/common-utils");
9
- const container_utils_1 = require("@fluidframework/container-utils");
10
- /**
11
- * Proxy to the real IDeltaQueue - used to restrict access
12
- */
13
- class DeltaQueueProxy extends common_utils_1.EventForwarder {
14
- constructor(queue) {
15
- super(queue);
16
- this.queue = queue;
17
- }
18
- get paused() {
19
- return this.queue.paused;
20
- }
21
- get length() {
22
- return this.queue.length;
23
- }
24
- get idle() {
25
- return this.queue.idle;
26
- }
27
- peek() {
28
- return this.queue.peek();
29
- }
30
- toArray() {
31
- return this.queue.toArray();
32
- }
33
- // back-compat: usage removed in 0.33, remove in future versions
34
- async systemPause() {
35
- return this.pause();
36
- }
37
- async pause() {
38
- return this.queue.pause();
39
- }
40
- // back-compat: usage removed in 0.33, remove in future versions
41
- async systemResume() {
42
- return this.resume();
43
- }
44
- async resume() {
45
- this.queue.resume();
46
- }
47
- async waitTillProcessingDone() {
48
- return this.queue.waitTillProcessingDone();
49
- }
50
- }
51
- exports.DeltaQueueProxy = DeltaQueueProxy;
52
- /**
53
- * Proxy to the real IDeltaManager - used to restrict access
54
- */
55
- class DeltaManagerProxy extends container_utils_1.DeltaManagerProxyBase {
56
- constructor(deltaManager) {
57
- super(deltaManager);
58
- this._inbound = new DeltaQueueProxy(deltaManager.inbound);
59
- this._outbound = new DeltaQueueProxy(deltaManager.outbound);
60
- this._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);
61
- }
62
- get inbound() {
63
- return this._inbound;
64
- }
65
- get outbound() {
66
- return this._outbound;
67
- }
68
- get inboundSignal() {
69
- return this._inboundSignal;
70
- }
71
- dispose() {
72
- this._inbound.dispose();
73
- this._outbound.dispose();
74
- this._inboundSignal.dispose();
75
- super.dispose();
76
- }
77
- }
78
- exports.DeltaManagerProxy = DeltaManagerProxy;
79
- //# sourceMappingURL=deltaManagerProxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deltaManagerProxy.js","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+DAA8D;AAM9D,qEAAwE;AAExE;;GAEG;AACH,MAAa,eACZ,SAAQ,6BAAoC;IAe5C,YAA6B,KAAqB;QACjD,KAAK,CAAC,KAAK,CAAC,CAAC;QADe,UAAK,GAAL,KAAK,CAAgB;IAElD,CAAC;IAdD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;I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B,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAWM,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AAjCD,8CAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDeltaManager,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n} from \"@fluidframework/container-definitions\";\nimport { EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { DeltaManagerProxyBase } from \"@fluidframework/container-utils\";\n\n/**\n * Proxy to the real IDeltaQueue - used to restrict access\n */\nexport class DeltaQueueProxy<T>\n\textends EventForwarder<IDeltaQueueEvents<T>>\n\timplements IDeltaQueue<T>\n{\n\tpublic get paused(): boolean {\n\t\treturn this.queue.paused;\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.queue.length;\n\t}\n\n\tpublic get idle(): boolean {\n\t\treturn this.queue.idle;\n\t}\n\n\tconstructor(private readonly queue: IDeltaQueue<T>) {\n\t\tsuper(queue);\n\t}\n\n\tpublic peek(): T | undefined {\n\t\treturn this.queue.peek();\n\t}\n\n\tpublic toArray(): T[] {\n\t\treturn this.queue.toArray();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemPause(): Promise<void> {\n\t\treturn this.pause();\n\t}\n\n\tpublic async pause(): Promise<void> {\n\t\treturn this.queue.pause();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemResume(): Promise<void> {\n\t\treturn this.resume();\n\t}\n\n\tpublic async resume(): Promise<void> {\n\t\tthis.queue.resume();\n\t}\n\n\tpublic async waitTillProcessingDone() {\n\t\treturn this.queue.waitTillProcessingDone();\n\t}\n}\n\n/**\n * Proxy to the real IDeltaManager - used to restrict access\n */\nexport class DeltaManagerProxy\n\textends DeltaManagerProxyBase\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this._inbound;\n\t}\n\tprivate readonly _inbound: IDeltaQueue<ISequencedDocumentMessage>;\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this._outbound;\n\t}\n\tprivate readonly _outbound: IDeltaQueue<IDocumentMessage[]>;\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this._inboundSignal;\n\t}\n\tprivate readonly _inboundSignal: IDeltaQueue<ISignalMessage>;\n\n\tconstructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n\t\tsuper(deltaManager);\n\n\t\tthis._inbound = new DeltaQueueProxy(deltaManager.inbound);\n\t\tthis._outbound = new DeltaQueueProxy(deltaManager.outbound);\n\t\tthis._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._inbound.dispose();\n\t\tthis._outbound.dispose();\n\t\tthis._inboundSignal.dispose();\n\t\tsuper.dispose();\n\t}\n}\n"]}
@@ -1,19 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
6
- export declare class CollabWindowTracker {
7
- private readonly submit;
8
- private readonly NoopCountFrequency;
9
- private opsCountSinceNoop;
10
- private readonly timer;
11
- constructor(submit: (type: MessageType) => void, NoopTimeFrequency?: number, NoopCountFrequency?: number);
12
- /**
13
- * Schedules as ack to the server to update the reference sequence number
14
- */
15
- scheduleSequenceNumberUpdate(message: ISequencedDocumentMessage, immediateNoOp: boolean): void;
16
- private submitNoop;
17
- stopSequenceNumberUpdate(): void;
18
- }
19
- //# sourceMappingURL=collabWindowTracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collabWindowTracker.d.ts","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAyB9F,qBAAa,mBAAmB;IAK9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IANpC,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;gBAGxB,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,EACpD,iBAAiB,GAAE,MAAiC,EACnC,kBAAkB,GAAE,MAAkC;IAaxE;;OAEG;IACI,4BAA4B,CAClC,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,OAAO,GACpB,IAAI;IAuCP,OAAO,CAAC,UAAU;IAUX,wBAAwB,IAAI,IAAI;CASvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"collabWindowTracker.js","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAA6B,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC,6FAA6F;AAC7F,4GAA4G;AAC5G,yGAAyG;AACzG,2CAA2C;AAC3C,oHAAoH;AACpH,2FAA2F;AAC3F,kHAAkH;AAClH,+CAA+C;AAC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D,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;oBACvC,6CAA6C;oBAC7C,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;iBAC3B;gBACD,OAAO;YACR,CAAC,CAAC,CAAC;SACH;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC7B,IAAI,IAAI,CAAC,iBAAiB,KAAK,CAAC,EAAE;gBACjC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aACrB;YAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACrD;IACF,CAAC;IAEO,UAAU,CAAC,SAAkB;QACpC,6CAA6C;QAC7C,8EAA8E;QAC9E,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAE,YAAY,CAAC,MAAiC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5F,MAAM,CACL,IAAI,CAAC,iBAAiB,KAAK,CAAC,EAC5B,KAAK,CAAC,8EAA8E,CACpF,CAAC;IACH,CAAC;IAEM,wBAAwB;QAC9B,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,kGAAkG;QAClG,wGAAwG;QACxG,oDAAoD;QACpD,qGAAqG;QACrG,yFAAyF;QACzF,sBAAsB;IACvB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { isRuntimeMessage, MessageType2 } from \"@fluidframework/driver-utils\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class CollabWindowTracker {\n\tprivate opsCountSinceNoop = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tprivate readonly submit: (type: MessageType) => void,\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tif (NoopTimeFrequency !== Infinity) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// Can get here due to this.stopSequenceNumberUpdate() not resetting timer.\n\t\t\t\t// Also timer callback can fire even after timer cancellation if it was queued before cancellation.\n\t\t\t\tif (this.opsCountSinceNoop !== 0) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic scheduleSequenceNumberUpdate(\n\t\tmessage: ISequencedDocumentMessage,\n\t\timmediateNoOp: boolean,\n\t): void {\n\t\t// While processing a message, an immediate no-op can be requested.\n\t\t// i.e. to expedite approve or commit phase of quorum.\n\t\tif (immediateNoOp) {\n\t\t\tthis.submitNoop(true /* immediate */);\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsCountSinceNoop++;\n\t\tif (this.opsCountSinceNoop === this.NoopCountFrequency) {\n\t\t\t// Ensure we only send noop after a batch of many ops is processed\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (this.opsCountSinceNoop >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t\t// reset count now that all ops are processed\n\t\t\t\t\tthis.opsCountSinceNoop = 0;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\tif (this.opsCountSinceNoop === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tprivate submitNoop(immediate: boolean) {\n\t\t// Anything other than null is immediate noop\n\t\t// ADO:1385: Remove cast and use MessageType once definition changes propagate\n\t\tthis.submit(immediate ? (MessageType2.Accept as unknown as MessageType) : MessageType.NoOp);\n\t\tassert(\n\t\t\tthis.opsCountSinceNoop === 0,\n\t\t\t0x243 /* \"stopSequenceNumberUpdate should be called as result of sending any op!\" */,\n\t\t);\n\t}\n\n\tpublic stopSequenceNumberUpdate(): void {\n\t\tthis.opsCountSinceNoop = 0;\n\t\t// Ideally, we cancel timer here. But that will result in too often set/reset cycle if this client\n\t\t// keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)\n\t\t// for nothing, then have a ton of set/reset cycles.\n\t\t// Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer\n\t\t// expiration - it will restart the timer instead when it fires with adjusted expiration.\n\t\t// this.timer.clear();\n\t}\n}\n"]}
@@ -1,42 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { IDeltaManager, IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
6
- import { EventForwarder } from "@fluidframework/common-utils";
7
- import { IDocumentMessage, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/protocol-definitions";
8
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
9
- /**
10
- * Proxy to the real IDeltaQueue - used to restrict access
11
- */
12
- export declare class DeltaQueueProxy<T> extends EventForwarder<IDeltaQueueEvents<T>> implements IDeltaQueue<T> {
13
- private readonly queue;
14
- get paused(): boolean;
15
- get length(): number;
16
- get idle(): boolean;
17
- constructor(queue: IDeltaQueue<T>);
18
- peek(): T | undefined;
19
- toArray(): T[];
20
- systemPause(): Promise<void>;
21
- pause(): Promise<void>;
22
- systemResume(): Promise<void>;
23
- resume(): Promise<void>;
24
- waitTillProcessingDone(): Promise<{
25
- count: number;
26
- duration: number;
27
- }>;
28
- }
29
- /**
30
- * Proxy to the real IDeltaManager - used to restrict access
31
- */
32
- export declare class DeltaManagerProxy extends DeltaManagerProxyBase implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
33
- get inbound(): IDeltaQueue<ISequencedDocumentMessage>;
34
- private readonly _inbound;
35
- get outbound(): IDeltaQueue<IDocumentMessage[]>;
36
- private readonly _outbound;
37
- get inboundSignal(): IDeltaQueue<ISignalMessage>;
38
- private readonly _inboundSignal;
39
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
40
- dispose(): void;
41
- }
42
- //# sourceMappingURL=deltaManagerProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"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AkC;IAE5D,IAAW,aAAa,IAAI,WAAW,CAAC,cAAc,CAAC,CAEtD;IACD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;gBAEjD,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAQ7E,OAAO,IAAI,IAAI;CAMtB"}
@@ -1,74 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { EventForwarder } from "@fluidframework/common-utils";
6
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
7
- /**
8
- * Proxy to the real IDeltaQueue - used to restrict access
9
- */
10
- export class DeltaQueueProxy extends EventForwarder {
11
- constructor(queue) {
12
- super(queue);
13
- this.queue = queue;
14
- }
15
- get paused() {
16
- return this.queue.paused;
17
- }
18
- get length() {
19
- return this.queue.length;
20
- }
21
- get idle() {
22
- return this.queue.idle;
23
- }
24
- peek() {
25
- return this.queue.peek();
26
- }
27
- toArray() {
28
- return this.queue.toArray();
29
- }
30
- // back-compat: usage removed in 0.33, remove in future versions
31
- async systemPause() {
32
- return this.pause();
33
- }
34
- async pause() {
35
- return this.queue.pause();
36
- }
37
- // back-compat: usage removed in 0.33, remove in future versions
38
- async systemResume() {
39
- return this.resume();
40
- }
41
- async resume() {
42
- this.queue.resume();
43
- }
44
- async waitTillProcessingDone() {
45
- return this.queue.waitTillProcessingDone();
46
- }
47
- }
48
- /**
49
- * Proxy to the real IDeltaManager - used to restrict access
50
- */
51
- export class DeltaManagerProxy extends DeltaManagerProxyBase {
52
- constructor(deltaManager) {
53
- super(deltaManager);
54
- this._inbound = new DeltaQueueProxy(deltaManager.inbound);
55
- this._outbound = new DeltaQueueProxy(deltaManager.outbound);
56
- this._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);
57
- }
58
- get inbound() {
59
- return this._inbound;
60
- }
61
- get outbound() {
62
- return this._outbound;
63
- }
64
- get inboundSignal() {
65
- return this._inboundSignal;
66
- }
67
- dispose() {
68
- this._inbound.dispose();
69
- this._outbound.dispose();
70
- this._inboundSignal.dispose();
71
- super.dispose();
72
- }
73
- }
74
- //# sourceMappingURL=deltaManagerProxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deltaManagerProxy.js","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,MAAM,OAAO,eACZ,SAAQ,cAAoC;IAe5C,YAA6B,KAAqB;QACjD,KAAK,CAAC,KAAK,CAAC,CAAC;QADe,UAAK,GAAL,KAAK,CAAgB;IAElD,CAAC;IAdD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACxB,CAAC;IAMM,IAAI;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,gEAAgE;IACzD,KAAK,CAAC,WAAW;QACvB,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,KAAK;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,gEAAgE;IACzD,KAAK,CAAC,YAAY;QACxB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,MAAM;QAClB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,sBAAsB;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC;IAC5C,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,iBACZ,SAAQ,qBAAqB;IAkB7B,YAAY,YAAwE;QACnF,KAAK,CAAC,YAAY,CAAC,CAAC;QAEpB,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACvE,CAAC;IArBD,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAGD,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAGD,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAWM,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDeltaManager,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n} from \"@fluidframework/container-definitions\";\nimport { EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { DeltaManagerProxyBase } from \"@fluidframework/container-utils\";\n\n/**\n * Proxy to the real IDeltaQueue - used to restrict access\n */\nexport class DeltaQueueProxy<T>\n\textends EventForwarder<IDeltaQueueEvents<T>>\n\timplements IDeltaQueue<T>\n{\n\tpublic get paused(): boolean {\n\t\treturn this.queue.paused;\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.queue.length;\n\t}\n\n\tpublic get idle(): boolean {\n\t\treturn this.queue.idle;\n\t}\n\n\tconstructor(private readonly queue: IDeltaQueue<T>) {\n\t\tsuper(queue);\n\t}\n\n\tpublic peek(): T | undefined {\n\t\treturn this.queue.peek();\n\t}\n\n\tpublic toArray(): T[] {\n\t\treturn this.queue.toArray();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemPause(): Promise<void> {\n\t\treturn this.pause();\n\t}\n\n\tpublic async pause(): Promise<void> {\n\t\treturn this.queue.pause();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemResume(): Promise<void> {\n\t\treturn this.resume();\n\t}\n\n\tpublic async resume(): Promise<void> {\n\t\tthis.queue.resume();\n\t}\n\n\tpublic async waitTillProcessingDone() {\n\t\treturn this.queue.waitTillProcessingDone();\n\t}\n}\n\n/**\n * Proxy to the real IDeltaManager - used to restrict access\n */\nexport class DeltaManagerProxy\n\textends DeltaManagerProxyBase\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this._inbound;\n\t}\n\tprivate readonly _inbound: IDeltaQueue<ISequencedDocumentMessage>;\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this._outbound;\n\t}\n\tprivate readonly _outbound: IDeltaQueue<IDocumentMessage[]>;\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this._inboundSignal;\n\t}\n\tprivate readonly _inboundSignal: IDeltaQueue<ISignalMessage>;\n\n\tconstructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n\t\tsuper(deltaManager);\n\n\t\tthis._inbound = new DeltaQueueProxy(deltaManager.inbound);\n\t\tthis._outbound = new DeltaQueueProxy(deltaManager.outbound);\n\t\tthis._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._inbound.dispose();\n\t\tthis._outbound.dispose();\n\t\tthis._inboundSignal.dispose();\n\t\tsuper.dispose();\n\t}\n}\n"]}
@@ -1,109 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import {
7
- IDeltaManager,
8
- IDeltaQueue,
9
- IDeltaQueueEvents,
10
- } from "@fluidframework/container-definitions";
11
- import { EventForwarder } from "@fluidframework/common-utils";
12
- import {
13
- IDocumentMessage,
14
- ISequencedDocumentMessage,
15
- ISignalMessage,
16
- } from "@fluidframework/protocol-definitions";
17
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
18
-
19
- /**
20
- * Proxy to the real IDeltaQueue - used to restrict access
21
- */
22
- export class DeltaQueueProxy<T>
23
- extends EventForwarder<IDeltaQueueEvents<T>>
24
- implements IDeltaQueue<T>
25
- {
26
- public get paused(): boolean {
27
- return this.queue.paused;
28
- }
29
-
30
- public get length(): number {
31
- return this.queue.length;
32
- }
33
-
34
- public get idle(): boolean {
35
- return this.queue.idle;
36
- }
37
-
38
- constructor(private readonly queue: IDeltaQueue<T>) {
39
- super(queue);
40
- }
41
-
42
- public peek(): T | undefined {
43
- return this.queue.peek();
44
- }
45
-
46
- public toArray(): T[] {
47
- return this.queue.toArray();
48
- }
49
-
50
- // back-compat: usage removed in 0.33, remove in future versions
51
- public async systemPause(): Promise<void> {
52
- return this.pause();
53
- }
54
-
55
- public async pause(): Promise<void> {
56
- return this.queue.pause();
57
- }
58
-
59
- // back-compat: usage removed in 0.33, remove in future versions
60
- public async systemResume(): Promise<void> {
61
- return this.resume();
62
- }
63
-
64
- public async resume(): Promise<void> {
65
- this.queue.resume();
66
- }
67
-
68
- public async waitTillProcessingDone() {
69
- return this.queue.waitTillProcessingDone();
70
- }
71
- }
72
-
73
- /**
74
- * Proxy to the real IDeltaManager - used to restrict access
75
- */
76
- export class DeltaManagerProxy
77
- extends DeltaManagerProxyBase
78
- implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
79
- {
80
- public get inbound(): IDeltaQueue<ISequencedDocumentMessage> {
81
- return this._inbound;
82
- }
83
- private readonly _inbound: IDeltaQueue<ISequencedDocumentMessage>;
84
-
85
- public get outbound(): IDeltaQueue<IDocumentMessage[]> {
86
- return this._outbound;
87
- }
88
- private readonly _outbound: IDeltaQueue<IDocumentMessage[]>;
89
-
90
- public get inboundSignal(): IDeltaQueue<ISignalMessage> {
91
- return this._inboundSignal;
92
- }
93
- private readonly _inboundSignal: IDeltaQueue<ISignalMessage>;
94
-
95
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {
96
- super(deltaManager);
97
-
98
- this._inbound = new DeltaQueueProxy(deltaManager.inbound);
99
- this._outbound = new DeltaQueueProxy(deltaManager.outbound);
100
- this._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);
101
- }
102
-
103
- public dispose(): void {
104
- this._inbound.dispose();
105
- this._outbound.dispose();
106
- this._inboundSignal.dispose();
107
- super.dispose();
108
- }
109
- }