@fluidframework/task-manager 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.1
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/CHANGELOG.md +4 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +8 -3
- package/api-report/task-manager.api.md +8 -11
- package/dist/interfaces.cjs.map +1 -1
- package/dist/interfaces.d.ts +3 -6
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/task-manager-alpha.d.ts +4 -288
- package/dist/task-manager-beta.d.ts +22 -288
- package/dist/task-manager-public.d.ts +22 -288
- package/dist/task-manager-untrimmed.d.ts +5 -16
- package/dist/taskManager.cjs +2 -10
- package/dist/taskManager.cjs.map +1 -1
- package/dist/taskManager.d.ts +2 -10
- package/dist/taskManager.d.ts.map +1 -1
- package/lib/index.d.ts +2 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/interfaces.d.ts +3 -6
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.mjs.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/lib/task-manager-alpha.d.ts +4 -288
- package/lib/task-manager-beta.d.ts +22 -288
- package/lib/task-manager-public.d.ts +22 -288
- package/lib/task-manager-untrimmed.d.ts +5 -16
- package/lib/taskManager.d.ts +3 -11
- package/lib/taskManager.d.ts.map +1 -1
- package/lib/taskManager.mjs +2 -10
- package/lib/taskManager.mjs.map +1 -1
- package/lib/taskManagerFactory.d.ts +1 -1
- package/lib/taskManagerFactory.d.ts.map +1 -1
- package/package.json +20 -29
- package/src/interfaces.ts +3 -6
- package/src/packageVersion.ts +1 -1
- package/src/taskManager.ts +2 -10
|
@@ -16,296 +16,30 @@ import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
|
16
16
|
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
17
17
|
import { SharedObject } from '@fluidframework/shared-object-base';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
* A distributed data structure that tracks queues of clients that want to exclusively run a task.
|
|
21
|
-
*
|
|
22
|
-
* @example Creation
|
|
23
|
-
*
|
|
24
|
-
* To create a {@link TaskManager}, call the static create method:
|
|
25
|
-
*
|
|
26
|
-
* ```typescript
|
|
27
|
-
* const taskManager = TaskManager.create(this.runtime, id);
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @example Usage
|
|
31
|
-
*
|
|
32
|
-
* To volunteer for a task, use the {@link ITaskManager.volunteerForTask} method.
|
|
33
|
-
* This returns a Promise that will resolve once the client has acquired exclusive rights to run the task,
|
|
34
|
-
* or reject if the client is removed from the queue without acquiring the rights.
|
|
35
|
-
*
|
|
36
|
-
* ```typescript
|
|
37
|
-
* taskManager.volunteerForTask("NameOfTask")
|
|
38
|
-
* .then(() => { doTheTask(); })
|
|
39
|
-
* .catch((err) => { console.error(err); });
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* Alternatively, you can indefinitely volunteer for a task with the synchronous {@link ITaskManager.subscribeToTask}
|
|
43
|
-
* method. This method does not return a value, therefore you need to rely on eventing to know when you have acquired
|
|
44
|
-
* the rights to run the task (see below).
|
|
45
|
-
*
|
|
46
|
-
* ```typescript
|
|
47
|
-
* taskManager.subscribeToTask("NameOfTask");
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* To check if the local client is currently subscribed to a task, use the {@link ITaskManager.subscribed} method.
|
|
51
|
-
*
|
|
52
|
-
* ```typescript
|
|
53
|
-
* if (taskManager.subscribed("NameOfTask")) {
|
|
54
|
-
* console.log("This client is currently subscribed to the task.");
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* To release the rights to the task, use the {@link ITaskManager.abandon} method.
|
|
59
|
-
* The next client in the queue will then get the rights to run the task.
|
|
60
|
-
*
|
|
61
|
-
* ```typescript
|
|
62
|
-
* taskManager.abandon("NameOfTask");
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* To inspect your state in the queue, you can use the {@link ITaskManager.queued} and {@link ITaskManager.assigned}
|
|
66
|
-
* methods.
|
|
67
|
-
*
|
|
68
|
-
* ```typescript
|
|
69
|
-
* if (taskManager.queued("NameOfTask")) {
|
|
70
|
-
* console.log("This client is somewhere in the queue, potentially even having the task assignment.");
|
|
71
|
-
* }
|
|
72
|
-
*
|
|
73
|
-
* if (taskManager.assigned("NameOfTask")) {
|
|
74
|
-
* console.log("This client currently has the rights to run the task");
|
|
75
|
-
* }
|
|
76
|
-
* ```
|
|
77
|
-
*
|
|
78
|
-
* To signal to other connected clients that a task is completed, use the {@link ITaskManager.complete} method.
|
|
79
|
-
* This will release all clients from the queue and emit the "completed" event.
|
|
80
|
-
*
|
|
81
|
-
* ```typescript
|
|
82
|
-
* taskManager.complete("NameOfTask");
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* @example Eventing
|
|
86
|
-
*
|
|
87
|
-
* `ITaskManager` will emit events when a task is assigned to the client, when the task assignment is lost,
|
|
88
|
-
* and when a task was completed by another client.
|
|
89
|
-
*
|
|
90
|
-
* ```typescript
|
|
91
|
-
* taskManager.on("assigned", (taskId: string) => {
|
|
92
|
-
* console.log(`Client was assigned task: ${taskId}`);
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* taskManager.on("lost", (taskId: string) => {
|
|
96
|
-
* console.log(`Client released task: ${taskId}`);
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* taskManager.on("completed", (taskId: string) => {
|
|
100
|
-
* console.log(`Another client completed task: ${taskId}`);
|
|
101
|
-
* });
|
|
102
|
-
* ```
|
|
103
|
-
*
|
|
104
|
-
* These can be useful if the logic to volunteer for a task is separated from the logic to perform the task, such as
|
|
105
|
-
* when using {@link ITaskManager.subscribeToTask}.
|
|
106
|
-
*
|
|
107
|
-
* See {@link ITaskManagerEvents} for more details.
|
|
108
|
-
*
|
|
109
|
-
* @public
|
|
110
|
-
*/
|
|
111
|
-
export declare interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
|
|
112
|
-
/**
|
|
113
|
-
* Volunteer for the task. Returns a promise that resolves `true` if the task is assigned to the local client and
|
|
114
|
-
* `false` if the task was completed by another client. It rejects if the local client abandoned the task or
|
|
115
|
-
* disconnected while in queue.
|
|
116
|
-
* @param taskId - Identifier for the task
|
|
117
|
-
*/
|
|
118
|
-
volunteerForTask(taskId: string): Promise<boolean>;
|
|
119
|
-
/**
|
|
120
|
-
* Continuously volunteer for the task. Watch the "assigned" event to determine if the task is assigned.
|
|
121
|
-
* The local client will automatically re-enter the queue if it disconnects.
|
|
122
|
-
* @param taskId - Identifier for the task
|
|
123
|
-
*/
|
|
124
|
-
subscribeToTask(taskId: string): void;
|
|
125
|
-
/**
|
|
126
|
-
* Exit the queue, releasing the task if currently assigned.
|
|
127
|
-
* @param taskId - Identifier for the task
|
|
128
|
-
*/
|
|
129
|
-
abandon(taskId: string): void;
|
|
130
|
-
/**
|
|
131
|
-
* Check whether this client is the current assignee for the task and there is no outstanding abandon op that
|
|
132
|
-
* would abandon the assignment.
|
|
133
|
-
* @param taskId - Identifier for the task
|
|
134
|
-
*/
|
|
135
|
-
assigned(taskId: string): boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Check whether this client is either the current assignee, in queue, or we expect they will be in queue after
|
|
138
|
-
* outstanding ops have been ack'd.
|
|
139
|
-
* @param taskId - Identifier for the task
|
|
140
|
-
*/
|
|
141
|
-
queued(taskId: string): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Check whether this client is currently subscribed to the task.
|
|
144
|
-
* @param taskId - Identifier for the task
|
|
145
|
-
*/
|
|
146
|
-
subscribed(taskId: string): boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Marks a task as completed and releases all clients from its queue.
|
|
149
|
-
* @param taskId - Identifier for the task
|
|
150
|
-
*/
|
|
151
|
-
complete(taskId: string): void;
|
|
152
|
-
/**
|
|
153
|
-
* Check whether this client can currently volunteer for a task.
|
|
154
|
-
*/
|
|
155
|
-
canVolunteer(): boolean;
|
|
156
|
-
}
|
|
19
|
+
/* Excluded from this release type: IChannelAttributes */
|
|
157
20
|
|
|
158
|
-
|
|
159
|
-
* Events emitted by {@link TaskManager}.
|
|
160
|
-
*
|
|
161
|
-
* @public
|
|
162
|
-
*/
|
|
163
|
-
export declare interface ITaskManagerEvents extends ISharedObjectEvents {
|
|
164
|
-
/**
|
|
165
|
-
* Fires when a task has been exclusively assigned to the client.
|
|
166
|
-
*
|
|
167
|
-
* @remarks Does not account for known pending ops, but instead only reflects the current state.
|
|
168
|
-
*
|
|
169
|
-
* @eventProperty
|
|
170
|
-
*/
|
|
171
|
-
(event: "assigned", listener: TaskEventListener): any;
|
|
172
|
-
/**
|
|
173
|
-
* Fires when a task the client is queued for is completed.
|
|
174
|
-
*
|
|
175
|
-
* @eventProperty
|
|
176
|
-
*/
|
|
177
|
-
(event: "completed", listener: TaskEventListener): any;
|
|
178
|
-
/**
|
|
179
|
-
* Fires when the task assignment is lost by the local client.
|
|
180
|
-
*
|
|
181
|
-
* @remarks This could be due to the client disconnecting or by manually calling {@link ITaskManager.abandon}.
|
|
182
|
-
*
|
|
183
|
-
* @eventProperty
|
|
184
|
-
*/
|
|
185
|
-
(event: "lost", listener: TaskEventListener): any;
|
|
186
|
-
}
|
|
21
|
+
/* Excluded from this release type: IChannelFactory */
|
|
187
22
|
|
|
188
|
-
|
|
189
|
-
* Describes the event listener format for {@link ITaskManagerEvents} events.
|
|
190
|
-
*
|
|
191
|
-
* @param taskId - The unique identifier of the related task.
|
|
192
|
-
*
|
|
193
|
-
* @public
|
|
194
|
-
*/
|
|
195
|
-
export declare type TaskEventListener = (taskId: string) => void;
|
|
23
|
+
/* Excluded from this release type: IChannelStorageService */
|
|
196
24
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
*/
|
|
217
|
-
static getFactory(): IChannelFactory;
|
|
218
|
-
/**
|
|
219
|
-
* Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the
|
|
220
|
-
* queue, even if we know we've submitted an op that should eventually modify the queue.
|
|
221
|
-
*/
|
|
222
|
-
private readonly taskQueues;
|
|
223
|
-
private readonly opWatcher;
|
|
224
|
-
private readonly queueWatcher;
|
|
225
|
-
private readonly abandonWatcher;
|
|
226
|
-
private readonly connectionWatcher;
|
|
227
|
-
private readonly completedWatcher;
|
|
228
|
-
private messageId;
|
|
229
|
-
/**
|
|
230
|
-
* Tracks the most recent pending op for a given task
|
|
231
|
-
*/
|
|
232
|
-
private readonly latestPendingOps;
|
|
233
|
-
/**
|
|
234
|
-
* Tracks tasks that are this client is currently subscribed to.
|
|
235
|
-
*/
|
|
236
|
-
private readonly subscribedTasks;
|
|
237
|
-
/**
|
|
238
|
-
* Map to track tasks that have pending complete ops.
|
|
239
|
-
*/
|
|
240
|
-
private readonly pendingCompletedTasks;
|
|
241
|
-
/**
|
|
242
|
-
* Returns the clientId. Will return a placeholder if the runtime is detached and not yet assigned a clientId.
|
|
243
|
-
*/
|
|
244
|
-
private get clientId();
|
|
245
|
-
/**
|
|
246
|
-
* Returns a ReadOnlyInfo object to determine current read/write permissions.
|
|
247
|
-
*/
|
|
248
|
-
private get readOnlyInfo();
|
|
249
|
-
/**
|
|
250
|
-
* Constructs a new task manager. If the object is non-local an id and service interfaces will
|
|
251
|
-
* be provided
|
|
252
|
-
*
|
|
253
|
-
* @param runtime - data store runtime the task queue belongs to
|
|
254
|
-
* @param id - optional name of the task queue
|
|
255
|
-
*/
|
|
256
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
257
|
-
private submitVolunteerOp;
|
|
258
|
-
private submitAbandonOp;
|
|
259
|
-
private submitCompleteOp;
|
|
260
|
-
/**
|
|
261
|
-
* {@inheritDoc ITaskManager.volunteerForTask}
|
|
262
|
-
*/
|
|
263
|
-
volunteerForTask(taskId: string): Promise<boolean>;
|
|
264
|
-
/**
|
|
265
|
-
* {@inheritDoc ITaskManager.subscribeToTask}
|
|
266
|
-
*/
|
|
267
|
-
subscribeToTask(taskId: string): void;
|
|
268
|
-
/**
|
|
269
|
-
* {@inheritDoc ITaskManager.abandon}
|
|
270
|
-
*/
|
|
271
|
-
abandon(taskId: string): void;
|
|
272
|
-
/**
|
|
273
|
-
* {@inheritDoc ITaskManager.assigned}
|
|
274
|
-
*/
|
|
275
|
-
assigned(taskId: string): boolean;
|
|
276
|
-
/**
|
|
277
|
-
* {@inheritDoc ITaskManager.queued}
|
|
278
|
-
*/
|
|
279
|
-
queued(taskId: string): boolean;
|
|
280
|
-
/**
|
|
281
|
-
* {@inheritDoc ITaskManager.subscribed}
|
|
282
|
-
*/
|
|
283
|
-
subscribed(taskId: string): boolean;
|
|
284
|
-
/**
|
|
285
|
-
* {@inheritDoc ITaskManager.complete}
|
|
286
|
-
*/
|
|
287
|
-
complete(taskId: string): void;
|
|
288
|
-
/**
|
|
289
|
-
* {@inheritDoc ITaskManager.canVolunteer}
|
|
290
|
-
*/
|
|
291
|
-
canVolunteer(): boolean;
|
|
292
|
-
/* Excluded from this release type: summarizeCore */
|
|
293
|
-
/* Excluded from this release type: loadCore */
|
|
294
|
-
/* Excluded from this release type: initializeLocalCore */
|
|
295
|
-
/* Excluded from this release type: onDisconnect */
|
|
296
|
-
/* Excluded from this release type: onConnect */
|
|
297
|
-
/* Excluded from this release type: reSubmitCore */
|
|
298
|
-
/* Excluded from this release type: processCore */
|
|
299
|
-
private addClientToQueue;
|
|
300
|
-
private removeClientFromQueue;
|
|
301
|
-
private removeClientFromAllQueues;
|
|
302
|
-
/**
|
|
303
|
-
* Will replace all instances of the placeholderClientId with the current clientId. This should only be called when
|
|
304
|
-
* transitioning from detached to attached and this.runtime.clientId is defined.
|
|
305
|
-
*/
|
|
306
|
-
private replacePlaceholderInAllQueues;
|
|
307
|
-
private scrubClientsNotInQuorum;
|
|
308
|
-
applyStashedOp(): void;
|
|
309
|
-
}
|
|
25
|
+
/* Excluded from this release type: IFluidDataStoreRuntime */
|
|
26
|
+
|
|
27
|
+
/* Excluded from this release type: IFluidSerializer */
|
|
28
|
+
|
|
29
|
+
/* Excluded from this release type: ISharedObject */
|
|
30
|
+
|
|
31
|
+
/* Excluded from this release type: ISharedObjectEvents */
|
|
32
|
+
|
|
33
|
+
/* Excluded from this release type: ISummaryTreeWithStats */
|
|
34
|
+
|
|
35
|
+
/* Excluded from this release type: ITaskManager */
|
|
36
|
+
|
|
37
|
+
/* Excluded from this release type: ITaskManagerEvents */
|
|
38
|
+
|
|
39
|
+
/* Excluded from this release type: SharedObject */
|
|
40
|
+
|
|
41
|
+
/* Excluded from this release type: TaskEventListener */
|
|
42
|
+
|
|
43
|
+
/* Excluded from this release type: TaskManager */
|
|
310
44
|
|
|
311
45
|
export { }
|
|
@@ -105,8 +105,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
|
|
|
105
105
|
* when using {@link ITaskManager.subscribeToTask}.
|
|
106
106
|
*
|
|
107
107
|
* See {@link ITaskManagerEvents} for more details.
|
|
108
|
-
*
|
|
109
|
-
* @public
|
|
108
|
+
* @internal
|
|
110
109
|
*/
|
|
111
110
|
export declare interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
|
|
112
111
|
/**
|
|
@@ -157,8 +156,7 @@ export declare interface ITaskManager extends ISharedObject<ITaskManagerEvents>
|
|
|
157
156
|
|
|
158
157
|
/**
|
|
159
158
|
* Events emitted by {@link TaskManager}.
|
|
160
|
-
*
|
|
161
|
-
* @public
|
|
159
|
+
* @internal
|
|
162
160
|
*/
|
|
163
161
|
export declare interface ITaskManagerEvents extends ISharedObjectEvents {
|
|
164
162
|
/**
|
|
@@ -189,8 +187,7 @@ export declare interface ITaskManagerEvents extends ISharedObjectEvents {
|
|
|
189
187
|
* Describes the event listener format for {@link ITaskManagerEvents} events.
|
|
190
188
|
*
|
|
191
189
|
* @param taskId - The unique identifier of the related task.
|
|
192
|
-
*
|
|
193
|
-
* @public
|
|
190
|
+
* @internal
|
|
194
191
|
*/
|
|
195
192
|
export declare type TaskEventListener = (taskId: string) => void;
|
|
196
193
|
|
|
@@ -198,7 +195,7 @@ export declare type TaskEventListener = (taskId: string) => void;
|
|
|
198
195
|
* {@inheritDoc ITaskManager}
|
|
199
196
|
*
|
|
200
197
|
* @sealed
|
|
201
|
-
* @
|
|
198
|
+
* @internal
|
|
202
199
|
*/
|
|
203
200
|
export declare class TaskManager extends SharedObject<ITaskManagerEvents> implements ITaskManager {
|
|
204
201
|
/**
|
|
@@ -293,32 +290,25 @@ export declare class TaskManager extends SharedObject<ITaskManagerEvents> implem
|
|
|
293
290
|
* Create a summary for the task manager
|
|
294
291
|
*
|
|
295
292
|
* @returns the summary of the current state of the task manager
|
|
296
|
-
* @internal
|
|
297
293
|
*/
|
|
298
294
|
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
299
295
|
/**
|
|
300
296
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
301
|
-
* @internal
|
|
302
297
|
*/
|
|
303
298
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
304
|
-
|
|
305
|
-
* @internal
|
|
306
|
-
*/
|
|
299
|
+
/***/
|
|
307
300
|
protected initializeLocalCore(): void;
|
|
308
301
|
/**
|
|
309
302
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
310
|
-
* @internal
|
|
311
303
|
*/
|
|
312
304
|
protected onDisconnect(): void;
|
|
313
305
|
/**
|
|
314
306
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}
|
|
315
|
-
* @internal
|
|
316
307
|
*/
|
|
317
308
|
protected onConnect(): void;
|
|
318
309
|
/**
|
|
319
310
|
* Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the
|
|
320
311
|
* queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.
|
|
321
|
-
* @internal
|
|
322
312
|
*/
|
|
323
313
|
protected reSubmitCore(): void;
|
|
324
314
|
/**
|
|
@@ -328,7 +318,6 @@ export declare class TaskManager extends SharedObject<ITaskManagerEvents> implem
|
|
|
328
318
|
* @param local - whether the message was sent by the local client
|
|
329
319
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
330
320
|
* For messages from a remote client, this will be undefined.
|
|
331
|
-
* @internal
|
|
332
321
|
*/
|
|
333
322
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
334
323
|
private addClientToQueue;
|
package/lib/taskManager.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
|
|
|
6
6
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
7
|
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
8
8
|
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
|
|
9
|
-
import { ITaskManager, ITaskManagerEvents } from "./interfaces";
|
|
9
|
+
import { ITaskManager, ITaskManagerEvents } from "./interfaces.mjs";
|
|
10
10
|
/**
|
|
11
11
|
* {@inheritDoc ITaskManager}
|
|
12
12
|
*
|
|
13
13
|
* @sealed
|
|
14
|
-
* @
|
|
14
|
+
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare class TaskManager extends SharedObject<ITaskManagerEvents> implements ITaskManager {
|
|
17
17
|
/**
|
|
@@ -106,32 +106,25 @@ export declare class TaskManager extends SharedObject<ITaskManagerEvents> implem
|
|
|
106
106
|
* Create a summary for the task manager
|
|
107
107
|
*
|
|
108
108
|
* @returns the summary of the current state of the task manager
|
|
109
|
-
* @internal
|
|
110
109
|
*/
|
|
111
110
|
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
112
111
|
/**
|
|
113
112
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
114
|
-
* @internal
|
|
115
113
|
*/
|
|
116
114
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
117
|
-
|
|
118
|
-
* @internal
|
|
119
|
-
*/
|
|
115
|
+
/***/
|
|
120
116
|
protected initializeLocalCore(): void;
|
|
121
117
|
/**
|
|
122
118
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
123
|
-
* @internal
|
|
124
119
|
*/
|
|
125
120
|
protected onDisconnect(): void;
|
|
126
121
|
/**
|
|
127
122
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}
|
|
128
|
-
* @internal
|
|
129
123
|
*/
|
|
130
124
|
protected onConnect(): void;
|
|
131
125
|
/**
|
|
132
126
|
* Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the
|
|
133
127
|
* queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.
|
|
134
|
-
* @internal
|
|
135
128
|
*/
|
|
136
129
|
protected reSubmitCore(): void;
|
|
137
130
|
/**
|
|
@@ -141,7 +134,6 @@ export declare class TaskManager extends SharedObject<ITaskManagerEvents> implem
|
|
|
141
134
|
* @param local - whether the message was sent by the local client
|
|
142
135
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
143
136
|
* For messages from a remote client, this will be undefined.
|
|
144
|
-
* @internal
|
|
145
137
|
*/
|
|
146
138
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
147
139
|
private addClientToQueue;
|
package/lib/taskManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskManager.d.ts","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"taskManager.d.ts","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAKI,EAAE,yBAAyB,EAAe,MAAM,sCAAsC;OACtF,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OAEpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OAGpC,EAAE,YAAY,EAAE,kBAAkB,EAAE;AAqC3C;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,YAAY,CAAC,kBAAkB,CAAE,YAAW,YAAY;IACxF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAG/D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAE9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IAEjE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoC;IAEnE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoC;IAEtE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoC;IAErE,OAAO,CAAC,SAAS,CAAc;IAC/B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsC;IAEvE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAE1D;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAoC;IAE1E;;OAEG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;OAEG;IACH,OAAO,KAAK,YAAY,GAEvB;IAED;;;;;;OAMG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAwHvF,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,gBAAgB;IAoBxB;;OAEG;IACU,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAwF5C;;OAEG;IACI,eAAe,CAAC,MAAM,EAAE,MAAM;IA6ErC;;OAEG;IACI,OAAO,CAAC,MAAM,EAAE,MAAM;IAwB7B;;OAEG;IACI,QAAQ,CAAC,MAAM,EAAE,MAAM;IAa9B;;OAEG;IACI,MAAM,CAAC,MAAM,EAAE,MAAM;IAgB5B;;OAEG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI1C;;OAEG;IACI,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAmBrC;;OAEG;IACI,YAAY,IAAI,OAAO;IAQ9B;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAuB5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxE,KAAK;IACL,SAAS,CAAC,mBAAmB;IAE7B;;OAEG;IACH,SAAS,CAAC,YAAY;IAItB;;OAEG;IACH,SAAS,CAAC,SAAS;IAKnB;;;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,OAAO;IAyBzB,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,yBAAyB;IAMjC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAerC,OAAO,CAAC,uBAAuB;IAiBxB,cAAc;CAGrB"}
|
package/lib/taskManager.mjs
CHANGED
|
@@ -17,7 +17,7 @@ const placeholderClientId = "placeholder";
|
|
|
17
17
|
* {@inheritDoc ITaskManager}
|
|
18
18
|
*
|
|
19
19
|
* @sealed
|
|
20
|
-
* @
|
|
20
|
+
* @internal
|
|
21
21
|
*/
|
|
22
22
|
export class TaskManager extends SharedObject {
|
|
23
23
|
/**
|
|
@@ -453,7 +453,6 @@ export class TaskManager extends SharedObject {
|
|
|
453
453
|
* Create a summary for the task manager
|
|
454
454
|
*
|
|
455
455
|
* @returns the summary of the current state of the task manager
|
|
456
|
-
* @internal
|
|
457
456
|
*/
|
|
458
457
|
summarizeCore(serializer) {
|
|
459
458
|
if (this.runtime.clientId !== undefined) {
|
|
@@ -479,7 +478,6 @@ export class TaskManager extends SharedObject {
|
|
|
479
478
|
}
|
|
480
479
|
/**
|
|
481
480
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
482
|
-
* @internal
|
|
483
481
|
*/
|
|
484
482
|
async loadCore(storage) {
|
|
485
483
|
const content = await readAndParse(storage, snapshotFileName);
|
|
@@ -488,20 +486,16 @@ export class TaskManager extends SharedObject {
|
|
|
488
486
|
});
|
|
489
487
|
this.scrubClientsNotInQuorum();
|
|
490
488
|
}
|
|
491
|
-
|
|
492
|
-
* @internal
|
|
493
|
-
*/
|
|
489
|
+
/***/
|
|
494
490
|
initializeLocalCore() { }
|
|
495
491
|
/**
|
|
496
492
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
497
|
-
* @internal
|
|
498
493
|
*/
|
|
499
494
|
onDisconnect() {
|
|
500
495
|
this.connectionWatcher.emit("disconnect");
|
|
501
496
|
}
|
|
502
497
|
/**
|
|
503
498
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}
|
|
504
|
-
* @internal
|
|
505
499
|
*/
|
|
506
500
|
onConnect() {
|
|
507
501
|
this.connectionWatcher.emit("connect");
|
|
@@ -510,7 +504,6 @@ export class TaskManager extends SharedObject {
|
|
|
510
504
|
/**
|
|
511
505
|
* Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the
|
|
512
506
|
* queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.
|
|
513
|
-
* @internal
|
|
514
507
|
*/
|
|
515
508
|
reSubmitCore() { }
|
|
516
509
|
/**
|
|
@@ -520,7 +513,6 @@ export class TaskManager extends SharedObject {
|
|
|
520
513
|
* @param local - whether the message was sent by the local client
|
|
521
514
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
522
515
|
* For messages from a remote client, this will be undefined.
|
|
523
|
-
* @internal
|
|
524
516
|
*/
|
|
525
517
|
processCore(message, local, localOpMetadata) {
|
|
526
518
|
if (message.type === MessageType.Operation) {
|