@fluidframework/task-manager 2.53.0 → 2.60.0

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/task-manager
2
2
 
3
+ ## 2.60.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.53.0
4
8
 
5
9
  Dependency updates only.
@@ -1,10 +1,10 @@
1
- ## Alpha API Report File for "@fluidframework/task-manager"
1
+ ## Beta API Report File for "@fluidframework/task-manager"
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
5
5
  ```ts
6
6
 
7
- // @alpha @legacy
7
+ // @beta @legacy
8
8
  export interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
9
9
  abandon(taskId: string): void;
10
10
  assigned(taskId: string): boolean;
@@ -16,7 +16,7 @@ export interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
16
16
  volunteerForTask(taskId: string): Promise<boolean>;
17
17
  }
18
18
 
19
- // @alpha @legacy
19
+ // @beta @legacy
20
20
  export interface ITaskManagerEvents extends ISharedObjectEvents {
21
21
  // @eventProperty
22
22
  (event: "assigned", listener: TaskEventListener): any;
@@ -26,13 +26,13 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
26
26
  (event: "lost", listener: TaskEventListener): any;
27
27
  }
28
28
 
29
- // @alpha @legacy
29
+ // @beta @legacy
30
30
  export type TaskEventListener = (taskId: string) => void;
31
31
 
32
- // @alpha @legacy
32
+ // @beta @legacy
33
33
  export const TaskManager: ISharedObjectKind<ITaskManager> & SharedObjectKind<ITaskManager>;
34
34
 
35
- // @alpha @legacy
35
+ // @beta @legacy
36
36
  export type TaskManager = ITaskManager;
37
37
 
38
38
  ```
@@ -7,14 +7,12 @@ import type { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-
7
7
  * Describes the event listener format for {@link ITaskManagerEvents} events.
8
8
  *
9
9
  * @param taskId - The unique identifier of the related task.
10
- * @legacy
11
- * @alpha
10
+ * @legacy @beta
12
11
  */
13
12
  export type TaskEventListener = (taskId: string) => void;
14
13
  /**
15
14
  * Events emitted by {@link ITaskManager}.
16
- * @legacy
17
- * @alpha
15
+ * @legacy @beta
18
16
  */
19
17
  export interface ITaskManagerEvents extends ISharedObjectEvents {
20
18
  /**
@@ -129,8 +127,7 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
129
127
  * when using {@link ITaskManager.subscribeToTask}.
130
128
  *
131
129
  * See {@link ITaskManagerEvents} for more details.
132
- * @legacy
133
- * @alpha
130
+ * @legacy @beta
134
131
  */
135
132
  export interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
136
133
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,mBAAmB,EACnB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC9D;;;;;;OAMG;IACH,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,OAAE;IAEjD;;;;OAIG;IACH,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,OAAE;IAElD;;;;;;OAMG;IACH,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,OAAE;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,MAAM,WAAW,YAAa,SAAQ,aAAa,CAAC,kBAAkB,CAAC;IACtE;;;;;OAKG;IACH,gBAAgB,CAA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AAC,kBAAkB,CAAC;IACtE;;;;;OAKG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnD;;;;OAIG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhC;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * Describes the event listener format for {@link ITaskManagerEvents} events.\n *\n * @param taskId - The unique identifier of the related task.\n * @legacy\n * @alpha\n */\nexport type TaskEventListener = (taskId: string) => void;\n\n/**\n * Events emitted by {@link ITaskManager}.\n * @legacy\n * @alpha\n */\nexport interface ITaskManagerEvents extends ISharedObjectEvents {\n\t/**\n\t * Fires when a task has been exclusively assigned to the client.\n\t *\n\t * @remarks Does not account for known pending ops, but instead only reflects the current state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"assigned\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when a task the client is queued for is completed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"completed\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when the task assignment is lost by the local client.\n\t *\n\t * @remarks This could be due to the client disconnecting or by manually calling {@link ITaskManager.abandon}.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"lost\", listener: TaskEventListener);\n}\n\n/**\n * A distributed data structure that tracks queues of clients that want to exclusively run a task.\n *\n * @example Creation\n *\n * To create a {@link ITaskManager}, call the static create method:\n *\n * ```typescript\n * const taskManager = TaskManager.create(this.runtime, id);\n * ```\n *\n * @example Usage\n *\n * To volunteer for a task, use the {@link ITaskManager.volunteerForTask} method.\n * This returns a Promise that will resolve once the client has acquired exclusive rights to run the task,\n * or reject if the client is removed from the queue without acquiring the rights.\n *\n * ```typescript\n * taskManager.volunteerForTask(\"NameOfTask\")\n * .then(() => { doTheTask(); })\n * .catch((err) => { console.error(err); });\n * ```\n *\n * Alternatively, you can indefinitely volunteer for a task with the synchronous {@link ITaskManager.subscribeToTask}\n * method. This method does not return a value, therefore you need to rely on eventing to know when you have acquired\n * the rights to run the task (see below).\n *\n * ```typescript\n * taskManager.subscribeToTask(\"NameOfTask\");\n * ```\n *\n * To check if the local client is currently subscribed to a task, use the {@link ITaskManager.subscribed} method.\n *\n * ```typescript\n * if (taskManager.subscribed(\"NameOfTask\")) {\n * console.log(\"This client is currently subscribed to the task.\");\n * }\n * ```\n *\n * To release the rights to the task, use the {@link ITaskManager.abandon} method.\n * The next client in the queue will then get the rights to run the task.\n *\n * ```typescript\n * taskManager.abandon(\"NameOfTask\");\n * ```\n *\n * To inspect your state in the queue, you can use the {@link ITaskManager.queued} and {@link ITaskManager.assigned}\n * methods.\n *\n * ```typescript\n * if (taskManager.queued(\"NameOfTask\")) {\n * console.log(\"This client is somewhere in the queue, potentially even having the task assignment.\");\n * }\n *\n * if (taskManager.assigned(\"NameOfTask\")) {\n * console.log(\"This client currently has the rights to run the task\");\n * }\n * ```\n *\n * To signal to other connected clients that a task is completed, use the {@link ITaskManager.complete} method.\n * This will release all clients from the queue and emit the \"completed\" event.\n *\n * ```typescript\n * taskManager.complete(\"NameOfTask\");\n * ```\n *\n * @example Eventing\n *\n * `ITaskManager` will emit events when a task is assigned to the client, when the task assignment is lost,\n * and when a task was completed by another client.\n *\n * ```typescript\n * taskManager.on(\"assigned\", (taskId: string) => {\n * console.log(`Client was assigned task: ${taskId}`);\n * });\n *\n * taskManager.on(\"lost\", (taskId: string) => {\n * console.log(`Client released task: ${taskId}`);\n * });\n *\n * taskManager.on(\"completed\", (taskId: string) => {\n * console.log(`Another client completed task: ${taskId}`);\n * });\n * ```\n *\n * These can be useful if the logic to volunteer for a task is separated from the logic to perform the task, such as\n * when using {@link ITaskManager.subscribeToTask}.\n *\n * See {@link ITaskManagerEvents} for more details.\n * @legacy\n * @alpha\n */\nexport interface ITaskManager extends ISharedObject<ITaskManagerEvents> {\n\t/**\n\t * Volunteer for the task. Returns a promise that resolves `true` if the task is assigned to the local client and\n\t * `false` if the task was completed by another client. It rejects if the local client abandoned the task or\n\t * disconnected while in queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tvolunteerForTask(taskId: string): Promise<boolean>;\n\n\t/**\n\t * Continuously volunteer for the task. Watch the \"assigned\" event to determine if the task is assigned.\n\t * The local client will automatically re-enter the queue if it disconnects.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribeToTask(taskId: string): void;\n\n\t/**\n\t * Exit the queue, releasing the task if currently assigned.\n\t * @param taskId - Identifier for the task\n\t */\n\tabandon(taskId: string): void;\n\n\t/**\n\t * Check whether this client is the current assignee for the task and there is no outstanding abandon op that\n\t * would abandon the assignment.\n\t * @param taskId - Identifier for the task\n\t */\n\tassigned(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is either the current assignee, in queue, or we expect they will be in queue after\n\t * outstanding ops have been ack'd.\n\t * @param taskId - Identifier for the task\n\t */\n\tqueued(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is currently subscribed to the task.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribed(taskId: string): boolean;\n\n\t/**\n\t * Marks a task as completed and releases all clients from its queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tcomplete(taskId: string): void;\n\n\t/**\n\t * Check whether this client can currently volunteer for a task.\n\t */\n\tcanVolunteer(): boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * Describes the event listener format for {@link ITaskManagerEvents} events.\n *\n * @param taskId - The unique identifier of the related task.\n * @legacy @beta\n */\nexport type TaskEventListener = (taskId: string) => void;\n\n/**\n * Events emitted by {@link ITaskManager}.\n * @legacy @beta\n */\nexport interface ITaskManagerEvents extends ISharedObjectEvents {\n\t/**\n\t * Fires when a task has been exclusively assigned to the client.\n\t *\n\t * @remarks Does not account for known pending ops, but instead only reflects the current state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"assigned\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when a task the client is queued for is completed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"completed\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when the task assignment is lost by the local client.\n\t *\n\t * @remarks This could be due to the client disconnecting or by manually calling {@link ITaskManager.abandon}.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"lost\", listener: TaskEventListener);\n}\n\n/**\n * A distributed data structure that tracks queues of clients that want to exclusively run a task.\n *\n * @example Creation\n *\n * To create a {@link ITaskManager}, call the static create method:\n *\n * ```typescript\n * const taskManager = TaskManager.create(this.runtime, id);\n * ```\n *\n * @example Usage\n *\n * To volunteer for a task, use the {@link ITaskManager.volunteerForTask} method.\n * This returns a Promise that will resolve once the client has acquired exclusive rights to run the task,\n * or reject if the client is removed from the queue without acquiring the rights.\n *\n * ```typescript\n * taskManager.volunteerForTask(\"NameOfTask\")\n * .then(() => { doTheTask(); })\n * .catch((err) => { console.error(err); });\n * ```\n *\n * Alternatively, you can indefinitely volunteer for a task with the synchronous {@link ITaskManager.subscribeToTask}\n * method. This method does not return a value, therefore you need to rely on eventing to know when you have acquired\n * the rights to run the task (see below).\n *\n * ```typescript\n * taskManager.subscribeToTask(\"NameOfTask\");\n * ```\n *\n * To check if the local client is currently subscribed to a task, use the {@link ITaskManager.subscribed} method.\n *\n * ```typescript\n * if (taskManager.subscribed(\"NameOfTask\")) {\n * console.log(\"This client is currently subscribed to the task.\");\n * }\n * ```\n *\n * To release the rights to the task, use the {@link ITaskManager.abandon} method.\n * The next client in the queue will then get the rights to run the task.\n *\n * ```typescript\n * taskManager.abandon(\"NameOfTask\");\n * ```\n *\n * To inspect your state in the queue, you can use the {@link ITaskManager.queued} and {@link ITaskManager.assigned}\n * methods.\n *\n * ```typescript\n * if (taskManager.queued(\"NameOfTask\")) {\n * console.log(\"This client is somewhere in the queue, potentially even having the task assignment.\");\n * }\n *\n * if (taskManager.assigned(\"NameOfTask\")) {\n * console.log(\"This client currently has the rights to run the task\");\n * }\n * ```\n *\n * To signal to other connected clients that a task is completed, use the {@link ITaskManager.complete} method.\n * This will release all clients from the queue and emit the \"completed\" event.\n *\n * ```typescript\n * taskManager.complete(\"NameOfTask\");\n * ```\n *\n * @example Eventing\n *\n * `ITaskManager` will emit events when a task is assigned to the client, when the task assignment is lost,\n * and when a task was completed by another client.\n *\n * ```typescript\n * taskManager.on(\"assigned\", (taskId: string) => {\n * console.log(`Client was assigned task: ${taskId}`);\n * });\n *\n * taskManager.on(\"lost\", (taskId: string) => {\n * console.log(`Client released task: ${taskId}`);\n * });\n *\n * taskManager.on(\"completed\", (taskId: string) => {\n * console.log(`Another client completed task: ${taskId}`);\n * });\n * ```\n *\n * These can be useful if the logic to volunteer for a task is separated from the logic to perform the task, such as\n * when using {@link ITaskManager.subscribeToTask}.\n *\n * See {@link ITaskManagerEvents} for more details.\n * @legacy @beta\n */\nexport interface ITaskManager extends ISharedObject<ITaskManagerEvents> {\n\t/**\n\t * Volunteer for the task. Returns a promise that resolves `true` if the task is assigned to the local client and\n\t * `false` if the task was completed by another client. It rejects if the local client abandoned the task or\n\t * disconnected while in queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tvolunteerForTask(taskId: string): Promise<boolean>;\n\n\t/**\n\t * Continuously volunteer for the task. Watch the \"assigned\" event to determine if the task is assigned.\n\t * The local client will automatically re-enter the queue if it disconnects.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribeToTask(taskId: string): void;\n\n\t/**\n\t * Exit the queue, releasing the task if currently assigned.\n\t * @param taskId - Identifier for the task\n\t */\n\tabandon(taskId: string): void;\n\n\t/**\n\t * Check whether this client is the current assignee for the task and there is no outstanding abandon op that\n\t * would abandon the assignment.\n\t * @param taskId - Identifier for the task\n\t */\n\tassigned(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is either the current assignee, in queue, or we expect they will be in queue after\n\t * outstanding ops have been ack'd.\n\t * @param taskId - Identifier for the task\n\t */\n\tqueued(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is currently subscribed to the task.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribed(taskId: string): boolean;\n\n\t/**\n\t * Marks a task as completed and releases all clients from its queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tcomplete(taskId: string): void;\n\n\t/**\n\t * Check whether this client can currently volunteer for a task.\n\t */\n\tcanVolunteer(): boolean;\n}\n"]}
@@ -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/task-manager";
8
- export declare const pkgVersion = "2.53.0";
8
+ export declare const pkgVersion = "2.60.0";
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/task-manager";
11
- exports.pkgVersion = "2.53.0";
11
+ exports.pkgVersion = "2.60.0";
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,QAAQ,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/task-manager\";\nexport const pkgVersion = \"2.53.0\";\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,QAAQ,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/task-manager\";\nexport const pkgVersion = \"2.60.0\";\n"]}
@@ -12,8 +12,7 @@ import type { ITaskManager, ITaskManagerEvents } from "./interfaces.js";
12
12
  * {@inheritDoc ITaskManager}
13
13
  *
14
14
  * @sealed
15
- * @legacy
16
- * @alpha
15
+ * @legacy @beta
17
16
  */
18
17
  export declare class TaskManagerClass extends SharedObject<ITaskManagerEvents> implements ITaskManager {
19
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taskManager.d.ts","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EAC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 +19,7 @@ const placeholderClientId = "placeholder";
19
19
  * {@inheritDoc ITaskManager}
20
20
  *
21
21
  * @sealed
22
- * @legacy
23
- * @alpha
22
+ * @legacy @beta
24
23
  */
25
24
  class TaskManagerClass extends internal_4.SharedObject {
26
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taskManager.js","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA4D;AAE5D,kEAA8E;AAO9E,0EAA0E;AAC1E,oEAAqE;AAGrE,0EAGqD;AAgCrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,MAAa,gBACZ,SAAQ,uBAAgC;IAoCxC;;OAEG;IACH,IAAY,QAAQ;QACnB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,IAAY,YAAY;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACH,YACC,EAAU,EACV,OAA+B,EAC/B,UAA8B;QAE9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC;QA3DtD;;;WAGG;QACc,eAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;QAE1D,2GAA2G;QAC1F,cAAS,GAAiB,IAAI,2BAAY,EAAE,CAAC;QAC9D,sFAAsF;QACrE,iBAAY,GAAiB,IAAI,2BAAY,EAAE,CAAC;QACjE,qFAAqF;QACpE,mBAAc,GAAiB,IAAI,2BAAY,EAAE,CAAC;QACnE,8EAA8E;QAC7D,sBAAiB,GAAiB,IAAI,2BAAY,EAAE,CAAC;QACtE,qFAAqF;QACpE,qBAAgB,GAAiB,IAAI,2BAAY,EA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EAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;CACD;AA1sBD,4CA0sBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ReadOnlyInfo } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager, ITaskManagerEvents } from \"./interfaces.js\";\n\n/**\n * Description of a task manager operation\n */\ntype ITaskManagerOperation =\n\t| ITaskManagerVolunteerOperation\n\t| ITaskManagerAbandonOperation\n\t| ITaskManagerCompletedOperation;\n\ninterface ITaskManagerVolunteerOperation {\n\ttype: \"volunteer\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerAbandonOperation {\n\ttype: \"abandon\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerCompletedOperation {\n\ttype: \"complete\";\n\ttaskId: string;\n}\n\ninterface IPendingOp {\n\ttype: \"volunteer\" | \"abandon\" | \"complete\";\n\tmessageId: number;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * Placeholder clientId for detached scenarios.\n */\nconst placeholderClientId = \"placeholder\";\n\n/**\n * {@inheritDoc ITaskManager}\n *\n * @sealed\n * @legacy\n * @alpha\n */\nexport class TaskManagerClass\n\textends SharedObject<ITaskManagerEvents>\n\timplements ITaskManager\n{\n\t/**\n\t * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the\n\t * queue, even if we know we've submitted an op that should eventually modify the queue.\n\t */\n\tprivate readonly taskQueues = new Map<string, string[]>();\n\n\t// opWatcher emits for every op on this data store. This is just a repackaging of processCore into events.\n\tprivate readonly opWatcher: EventEmitter = new EventEmitter();\n\t// queueWatcher emits an event whenever the consensus state of the task queues changes\n\tprivate readonly queueWatcher: EventEmitter = new EventEmitter();\n\t// abandonWatcher emits an event whenever the local client calls abandon() on a task.\n\tprivate readonly abandonWatcher: EventEmitter = new EventEmitter();\n\t// connectionWatcher emits an event whenever we get connected or disconnected.\n\tprivate readonly connectionWatcher: EventEmitter = new EventEmitter();\n\t// completedWatcher emits an event whenever the local client receives a completed op.\n\tprivate readonly completedWatcher: EventEmitter = new EventEmitter();\n\n\tprivate messageId: number = -1;\n\t/**\n\t * Tracks the most recent pending op for a given task\n\t */\n\tprivate readonly latestPendingOps = new Map<string, IPendingOp>();\n\n\t/**\n\t * Tracks tasks that are this client is currently subscribed to.\n\t */\n\tprivate readonly subscribedTasks = new Set<string>();\n\n\t/**\n\t * Map to track tasks that have pending complete ops.\n\t */\n\tprivate readonly pendingCompletedTasks = new Map<string, number[]>();\n\n\t/**\n\t * Returns the clientId. Will return a placeholder if the runtime is detached and not yet assigned a clientId.\n\t */\n\tprivate get clientId(): string | undefined {\n\t\treturn this.isAttached() ? this.runtime.clientId : placeholderClientId;\n\t}\n\n\t/**\n\t * Returns a ReadOnlyInfo object to determine current read/write permissions.\n\t */\n\tprivate get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\t/**\n\t * Constructs a new task manager. If the object is non-local an id and service interfaces will\n\t * be provided\n\t *\n\t * @param runtime - data store runtime the task queue belongs to\n\t * @param id - optional name of the task queue\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_taskManager_\");\n\n\t\tthis.opWatcher.on(\n\t\t\t\"volunteer\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\t// We're tracking local ops from this connection. Filter out local ops during \"connecting\"\n\t\t\t\t// state since these were sent on the prior connection and were already cleared from the latestPendingOps.\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07b /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to volunteer and abandon multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"volunteer\", 0x07c /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.addClientToQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"abandon\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07d /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to abandon and volunteer multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"abandon\", 0x07e /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"complete\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x400 /* Unexpected op */);\n\t\t\t\t\t// Need to check the id, since it's possible to complete multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"complete\", 0x401 /* Unexpected op type */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove complete op from this.pendingCompletedTasks\n\t\t\t\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tpendingIds !== undefined && pendingIds.length > 0,\n\t\t\t\t\t\t0x402 /* pendingIds is empty */,\n\t\t\t\t\t);\n\t\t\t\t\tconst removed = pendingIds.shift();\n\t\t\t\t\tassert(removed === messageId, 0x403 /* Removed complete op id does not match */);\n\t\t\t\t}\n\n\t\t\t\t// For clients in queue, we need to remove them from the queue and raise the proper events.\n\t\t\t\tif (!local) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\t\t\t\tthis.emit(\"completed\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\truntime.getQuorum().on(\"removeMember\", (clientId: string) => {\n\t\t\tthis.removeClientFromAllQueues(clientId);\n\t\t});\n\n\t\tthis.queueWatcher.on(\n\t\t\t\"queueChange\",\n\t\t\t(taskId: string, oldLockHolder: string, newLockHolder: string) => {\n\t\t\t\t// If oldLockHolder is placeholderClientId we need to emit the task was lost during the attach process\n\t\t\t\tif (oldLockHolder === placeholderClientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Exit early if we are still catching up on reconnect -- we can't be the leader yet anyway.\n\t\t\t\tif (this.clientId === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (oldLockHolder !== this.clientId && newLockHolder === this.clientId) {\n\t\t\t\t\tthis.emit(\"assigned\", taskId);\n\t\t\t\t} else if (oldLockHolder === this.clientId && newLockHolder !== this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tthis.connectionWatcher.on(\"disconnect\", () => {\n\t\t\tassert(this.clientId !== undefined, 0x1d3 /* \"Missing client id on disconnect\" */);\n\n\t\t\t// We don't modify the taskQueues on disconnect (they still reflect the latest known consensus state).\n\t\t\t// After reconnect these will get cleaned up by observing the clientLeaves.\n\t\t\t// However we do need to recognize that we lost the lock if we had it. Calls to .queued() and\n\t\t\t// .assigned() are also connection-state-aware to be consistent.\n\t\t\tfor (const [taskId, clientQueue] of this.taskQueues.entries()) {\n\t\t\t\tif (this.isAttached() && clientQueue[0] === this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All of our outstanding ops will be for the old clientId even if they get ack'd\n\t\t\tthis.latestPendingOps.clear();\n\t\t});\n\t}\n\n\tprivate submitVolunteerOp(taskId: string): void {\n\t\tconst op: ITaskManagerVolunteerOperation = {\n\t\t\ttype: \"volunteer\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"volunteer\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitAbandonOp(taskId: string): void {\n\t\tconst op: ITaskManagerAbandonOperation = {\n\t\t\ttype: \"abandon\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"abandon\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitCompleteOp(taskId: string): void {\n\t\tconst op: ITaskManagerCompletedOperation = {\n\t\t\ttype: \"complete\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"complete\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\n\t\tif (this.pendingCompletedTasks.has(taskId)) {\n\t\t\tthis.pendingCompletedTasks.get(taskId)?.push(pendingOp.messageId);\n\t\t} else {\n\t\t\tthis.pendingCompletedTasks.set(taskId, [pendingOp.messageId]);\n\t\t}\n\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.volunteerForTask}\n\t */\n\tpublic async volunteerForTask(taskId: string): Promise<boolean> {\n\t\t// If we have the lock, resolve immediately\n\t\tif (this.assigned(taskId)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true) {\n\t\t\tconst error =\n\t\t\t\tthis.readOnlyInfo.permissions === true\n\t\t\t\t\t? new Error(\"Attempted to volunteer with read-only permissions\")\n\t\t\t\t\t: new Error(\"Attempted to volunteer in read-only state\");\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x472 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.connected) {\n\t\t\tthrow new Error(\"Attempted to volunteer in disconnected state\");\n\t\t}\n\n\t\t// This promise works even if we already have an outstanding volunteer op.\n\t\tconst lockAcquireP = new Promise<boolean>((resolve, reject) => {\n\t\t\tconst checkIfAcquiredLock = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Also check pending ops here because it's possible we are currently in the queue from a previous\n\t\t\t\t// lock attempt, but have an outstanding abandon AND the outstanding volunteer for this lock attempt.\n\t\t\t\t// If we reach the head of the queue based on the previous lock attempt, we don't want to resolve.\n\t\t\t\tif (this.assigned(taskId) && !this.latestPendingOps.has(taskId)) {\n\t\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\t\tresolve(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Abandoned before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst rejectOnDisconnect = (): void => {\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Disconnected before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\tresolve(false);\n\t\t\t};\n\n\t\t\tthis.queueWatcher.on(\"queueChange\", checkIfAcquiredLock);\n\t\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.on(\"disconnect\", rejectOnDisconnect);\n\t\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\t\t});\n\n\t\tif (!this.queued(taskId)) {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t}\n\t\treturn lockAcquireP;\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribeToTask}\n\t */\n\tpublic subscribeToTask(taskId: string): void {\n\t\tif (this.subscribed(taskId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true && this.readOnlyInfo.permissions === true) {\n\t\t\tthrow new Error(\"Attempted to subscribe with read-only permissions\");\n\t\t}\n\n\t\tconst submitVolunteerOp = (): void => {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t};\n\n\t\tconst disconnectHandler = (): void => {\n\t\t\t// Wait to be connected again and then re-submit volunteer op\n\t\t\tthis.connectionWatcher.once(\"connect\", submitVolunteerOp);\n\t\t};\n\n\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\tthis.connectionWatcher.on(\"disconnect\", disconnectHandler);\n\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x473 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\t// Because we volunteered with placeholderClientId, we need to wait for when we attach and are assigned\n\t\t\t// a real clientId. At that point we should re-enter the queue with a real volunteer op (assuming we are\n\t\t\t// connected).\n\t\t\tthis.runtime.once(\"attached\", () => {\n\t\t\t\tif (this.queued(taskId)) {\n\t\t\t\t\t// If we are already queued, then we were able to replace the placeholderClientId with our real\n\t\t\t\t\t// clientId and no action is required.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.connected) {\n\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t} else {\n\t\t\t\t\tthis.connectionWatcher.once(\"connect\", () => {\n\t\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (!this.connected) {\n\t\t\t// If we are disconnected (and attached), wait to be connected and submit volunteer op\n\t\t\tdisconnectHandler();\n\t\t} else if (!this.assigned(taskId) && !this.queued(taskId)) {\n\t\t\tsubmitVolunteerOp();\n\t\t}\n\t\tthis.subscribedTasks.add(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.abandon}\n\t */\n\tpublic abandon(taskId: string): void {\n\t\t// Always allow abandon if the client is subscribed to allow clients to unsubscribe while disconnected.\n\t\t// Otherwise, we should check to make sure the client is both connected queued for the task before sending an\n\t\t// abandon op.\n\t\tif (!this.subscribed(taskId) && !this.queued(taskId)) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x474 /* clientId is undefined */);\n\t\t\tthis.removeClientFromQueue(taskId, this.clientId);\n\t\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're subscribed but not queued, we don't need to submit an abandon op (probably offline)\n\t\tif (this.queued(taskId)) {\n\t\t\tthis.submitAbandonOp(taskId);\n\t\t}\n\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.assigned}\n\t */\n\tpublic assigned(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentAssignee = this.taskQueues.get(taskId)?.[0];\n\t\treturn (\n\t\t\tcurrentAssignee !== undefined &&\n\t\t\tcurrentAssignee === this.clientId &&\n\t\t\t!this.latestPendingOps.has(taskId)\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.queued}\n\t */\n\tpublic queued(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(this.clientId !== undefined, 0x07f /* \"clientId undefined\" */);\n\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\t// If we have no queue for the taskId, then no one has signed up for it.\n\t\treturn (\n\t\t\t((clientQueue?.includes(this.clientId) ?? false) &&\n\t\t\t\t!this.latestPendingOps.has(taskId)) ||\n\t\t\tthis.latestPendingOps.get(taskId)?.type === \"volunteer\"\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribed}\n\t */\n\tpublic subscribed(taskId: string): boolean {\n\t\treturn this.subscribedTasks.has(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.complete}\n\t */\n\tpublic complete(taskId: string): void {\n\t\tif (!this.assigned(taskId)) {\n\t\t\tthrow new Error(\"Attempted to mark task as complete while not being assigned\");\n\t\t}\n\n\t\t// If we are detached we will simulate auto-ack for the complete op. Therefore we only need to send the op if\n\t\t// we are attached. Additionally, we don't need to check if we are connected while detached.\n\t\tif (this.isAttached()) {\n\t\t\tif (!this.connected) {\n\t\t\t\tthrow new Error(\"Attempted to complete task in disconnected state\");\n\t\t\t}\n\t\t\tthis.submitCompleteOp(taskId);\n\t\t}\n\n\t\tthis.taskQueues.delete(taskId);\n\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\tthis.emit(\"completed\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.canVolunteer}\n\t */\n\tpublic canVolunteer(): boolean {\n\t\t// A client can volunteer for a task if it's both connected to the delta stream and in write mode.\n\t\t// this.connected reflects that condition, but is unintuitive and may be changed in the future. This API allows\n\t\t// us to make changes to this.connected without affecting our guidance on how to check if a client is eligible\n\t\t// to volunteer for a task.\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Create a summary for the task manager\n\t *\n\t * @returns the summary of the current state of the task manager\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tif (this.runtime.clientId === undefined) {\n\t\t\t// If the runtime has still not been assigned a clientId, we should not summarize with the placeholder\n\t\t\t// clientIds and instead remove them from the queues and require the client to re-volunteer when assigned\n\t\t\t// a new clientId.\n\t\t\tthis.removeClientFromAllQueues(placeholderClientId);\n\t\t} else {\n\t\t\t// If the runtime has been assigned an actual clientId by now, we can replace the placeholder clientIds\n\t\t\t// and maintain the task assignment.\n\t\t\tthis.replacePlaceholderInAllQueues();\n\t\t}\n\n\t\t// Only include tasks if there are clients in the queue.\n\t\tconst filteredMap = new Map<string, string[]>();\n\t\tfor (const [taskId, queue] of this.taskQueues) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tfilteredMap.set(taskId, queue);\n\t\t\t}\n\t\t}\n\t\tconst content = [...filteredMap.entries()];\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(content));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst content = await readAndParse<[string, string[]][]>(storage, snapshotFileName);\n\t\tfor (const [taskId, clientIdQueue] of content) {\n\t\t\tthis.taskQueues.set(taskId, clientIdQueue);\n\t\t}\n\t\tthis.scrubClientsNotInQuorum();\n\t}\n\n\t/***/\n\tprotected initializeLocalCore(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {\n\t\tthis.connectionWatcher.emit(\"disconnect\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}\n\t */\n\tprotected onConnect(): void {\n\t\tthis.connectionWatcher.emit(\"connect\");\n\t}\n\n\t//\n\t/**\n\t * Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the\n\t * queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.\n\t */\n\tprotected reSubmitCore(): void {}\n\n\t/**\n\t * Process a task manager operation\n\t *\n\t * @param message - the message to prepare\n\t * @param local - whether the message was sent by the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as ITaskManagerOperation;\n\t\t\tconst messageId = localOpMetadata as number;\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"volunteer\": {\n\t\t\t\t\tthis.opWatcher.emit(\"volunteer\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"abandon\": {\n\t\t\t\t\tthis.opWatcher.emit(\"abandon\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"complete\": {\n\t\t\t\t\tthis.opWatcher.emit(\"complete\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addClientToQueue(taskId: string, clientId: string): void {\n\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\tif (pendingIds !== undefined && pendingIds.length > 0) {\n\t\t\t// Ignore the volunteer op if we know this task is about to be completed\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the clientId exists in the quorum, or it is placeholderClientId (detached scenario)\n\t\tif (\n\t\t\tthis.runtime.getQuorum().getMembers().has(clientId) ||\n\t\t\tthis.clientId === placeholderClientId\n\t\t) {\n\t\t\t// Create the queue if it doesn't exist, and push the client on the back.\n\t\t\tlet clientQueue = this.taskQueues.get(taskId);\n\t\t\tif (clientQueue === undefined) {\n\t\t\t\tclientQueue = [];\n\t\t\t\tthis.taskQueues.set(taskId, clientQueue);\n\t\t\t}\n\n\t\t\tconst oldLockHolder = clientQueue[0];\n\t\t\tclientQueue.push(clientId);\n\t\t\tconst newLockHolder = clientQueue[0];\n\t\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeClientFromQueue(taskId: string, clientId: string): void {\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\tif (clientQueue === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldLockHolder =\n\t\t\tclientId === placeholderClientId ? placeholderClientId : clientQueue[0];\n\t\tconst clientIdIndex = clientQueue.indexOf(clientId);\n\t\tif (clientIdIndex !== -1) {\n\t\t\tclientQueue.splice(clientIdIndex, 1);\n\t\t\t// Clean up the queue if there are no more clients in it.\n\t\t\tif (clientQueue.length === 0) {\n\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t}\n\t\t}\n\t\tconst newLockHolder = clientQueue[0];\n\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t}\n\t}\n\n\tprivate removeClientFromAllQueues(clientId: string): void {\n\t\tfor (const taskId of this.taskQueues.keys()) {\n\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t}\n\t}\n\n\t/**\n\t * Will replace all instances of the placeholderClientId with the current clientId. This should only be called when\n\t * transitioning from detached to attached and this.runtime.clientId is defined.\n\t */\n\tprivate replacePlaceholderInAllQueues(): void {\n\t\tassert(\n\t\t\tthis.runtime.clientId !== undefined,\n\t\t\t0x475 /* this.runtime.clientId should be defined */,\n\t\t);\n\t\tfor (const clientQueue of this.taskQueues.values()) {\n\t\t\tconst clientIdIndex = clientQueue.indexOf(placeholderClientId);\n\t\t\tif (clientIdIndex !== -1) {\n\t\t\t\tclientQueue[clientIdIndex] = this.runtime.clientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This seems like it should be unnecessary if we can trust to receive the join/leave messages and\n\t// also have an accurate snapshot.\n\tprivate scrubClientsNotInQuorum(): void {\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tfor (const [taskId, clientQueue] of this.taskQueues) {\n\t\t\tconst filteredClientQueue = clientQueue.filter(\n\t\t\t\t(clientId) => quorum.getMember(clientId) !== undefined,\n\t\t\t);\n\t\t\tif (clientQueue.length !== filteredClientQueue.length) {\n\t\t\t\tif (filteredClientQueue.length === 0) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t} else {\n\t\t\t\t\tthis.taskQueues.set(taskId, filteredClientQueue);\n\t\t\t\t}\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyStashedOp(content: unknown): void {\n\t\tconst taskOp: ITaskManagerOperation = content as ITaskManagerOperation;\n\t\tswitch (taskOp.type) {\n\t\t\tcase \"abandon\": {\n\t\t\t\tthis.abandon(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"complete\": {\n\t\t\t\tthis.complete(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"volunteer\": {\n\t\t\t\tthis.subscribeToTask(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(taskOp);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"taskManager.js","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA4D;AAE5D,kEAA8E;AAO9E,0EAA0E;AAC1E,oEAAqE;AAGrE,0EAGqD;AAgCrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAa,gBACZ,SAAQ,uBAAgC;IAoCxC;;OAEG;IACH,IAAY,QAAQ;QACnB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,IAAY,YAAY;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;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,MAAM,MAAM,GAA0B,OAAgC,CAAC;QACvE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,SAAS,CAAC,CAAC,CAAC;gBAChB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC5B,MAAM;YACP,CAAC;YACD,KAAK,UAAU,CAAC,CAAC,CAAC;gBACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC7B,MAAM;YACP,CAAC;YACD,KAAK,WAAW,CAAC,CAAC,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACpC,MAAM;YACP,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;CACD;AA1sBD,4CA0sBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ReadOnlyInfo } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager, ITaskManagerEvents } from \"./interfaces.js\";\n\n/**\n * Description of a task manager operation\n */\ntype ITaskManagerOperation =\n\t| ITaskManagerVolunteerOperation\n\t| ITaskManagerAbandonOperation\n\t| ITaskManagerCompletedOperation;\n\ninterface ITaskManagerVolunteerOperation {\n\ttype: \"volunteer\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerAbandonOperation {\n\ttype: \"abandon\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerCompletedOperation {\n\ttype: \"complete\";\n\ttaskId: string;\n}\n\ninterface IPendingOp {\n\ttype: \"volunteer\" | \"abandon\" | \"complete\";\n\tmessageId: number;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * Placeholder clientId for detached scenarios.\n */\nconst placeholderClientId = \"placeholder\";\n\n/**\n * {@inheritDoc ITaskManager}\n *\n * @sealed\n * @legacy @beta\n */\nexport class TaskManagerClass\n\textends SharedObject<ITaskManagerEvents>\n\timplements ITaskManager\n{\n\t/**\n\t * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the\n\t * queue, even if we know we've submitted an op that should eventually modify the queue.\n\t */\n\tprivate readonly taskQueues = new Map<string, string[]>();\n\n\t// opWatcher emits for every op on this data store. This is just a repackaging of processCore into events.\n\tprivate readonly opWatcher: EventEmitter = new EventEmitter();\n\t// queueWatcher emits an event whenever the consensus state of the task queues changes\n\tprivate readonly queueWatcher: EventEmitter = new EventEmitter();\n\t// abandonWatcher emits an event whenever the local client calls abandon() on a task.\n\tprivate readonly abandonWatcher: EventEmitter = new EventEmitter();\n\t// connectionWatcher emits an event whenever we get connected or disconnected.\n\tprivate readonly connectionWatcher: EventEmitter = new EventEmitter();\n\t// completedWatcher emits an event whenever the local client receives a completed op.\n\tprivate readonly completedWatcher: EventEmitter = new EventEmitter();\n\n\tprivate messageId: number = -1;\n\t/**\n\t * Tracks the most recent pending op for a given task\n\t */\n\tprivate readonly latestPendingOps = new Map<string, IPendingOp>();\n\n\t/**\n\t * Tracks tasks that are this client is currently subscribed to.\n\t */\n\tprivate readonly subscribedTasks = new Set<string>();\n\n\t/**\n\t * Map to track tasks that have pending complete ops.\n\t */\n\tprivate readonly pendingCompletedTasks = new Map<string, number[]>();\n\n\t/**\n\t * Returns the clientId. Will return a placeholder if the runtime is detached and not yet assigned a clientId.\n\t */\n\tprivate get clientId(): string | undefined {\n\t\treturn this.isAttached() ? this.runtime.clientId : placeholderClientId;\n\t}\n\n\t/**\n\t * Returns a ReadOnlyInfo object to determine current read/write permissions.\n\t */\n\tprivate get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\t/**\n\t * Constructs a new task manager. If the object is non-local an id and service interfaces will\n\t * be provided\n\t *\n\t * @param runtime - data store runtime the task queue belongs to\n\t * @param id - optional name of the task queue\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_taskManager_\");\n\n\t\tthis.opWatcher.on(\n\t\t\t\"volunteer\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\t// We're tracking local ops from this connection. Filter out local ops during \"connecting\"\n\t\t\t\t// state since these were sent on the prior connection and were already cleared from the latestPendingOps.\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07b /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to volunteer and abandon multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"volunteer\", 0x07c /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.addClientToQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"abandon\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07d /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to abandon and volunteer multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"abandon\", 0x07e /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"complete\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x400 /* Unexpected op */);\n\t\t\t\t\t// Need to check the id, since it's possible to complete multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"complete\", 0x401 /* Unexpected op type */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove complete op from this.pendingCompletedTasks\n\t\t\t\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tpendingIds !== undefined && pendingIds.length > 0,\n\t\t\t\t\t\t0x402 /* pendingIds is empty */,\n\t\t\t\t\t);\n\t\t\t\t\tconst removed = pendingIds.shift();\n\t\t\t\t\tassert(removed === messageId, 0x403 /* Removed complete op id does not match */);\n\t\t\t\t}\n\n\t\t\t\t// For clients in queue, we need to remove them from the queue and raise the proper events.\n\t\t\t\tif (!local) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\t\t\t\tthis.emit(\"completed\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\truntime.getQuorum().on(\"removeMember\", (clientId: string) => {\n\t\t\tthis.removeClientFromAllQueues(clientId);\n\t\t});\n\n\t\tthis.queueWatcher.on(\n\t\t\t\"queueChange\",\n\t\t\t(taskId: string, oldLockHolder: string, newLockHolder: string) => {\n\t\t\t\t// If oldLockHolder is placeholderClientId we need to emit the task was lost during the attach process\n\t\t\t\tif (oldLockHolder === placeholderClientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Exit early if we are still catching up on reconnect -- we can't be the leader yet anyway.\n\t\t\t\tif (this.clientId === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (oldLockHolder !== this.clientId && newLockHolder === this.clientId) {\n\t\t\t\t\tthis.emit(\"assigned\", taskId);\n\t\t\t\t} else if (oldLockHolder === this.clientId && newLockHolder !== this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tthis.connectionWatcher.on(\"disconnect\", () => {\n\t\t\tassert(this.clientId !== undefined, 0x1d3 /* \"Missing client id on disconnect\" */);\n\n\t\t\t// We don't modify the taskQueues on disconnect (they still reflect the latest known consensus state).\n\t\t\t// After reconnect these will get cleaned up by observing the clientLeaves.\n\t\t\t// However we do need to recognize that we lost the lock if we had it. Calls to .queued() and\n\t\t\t// .assigned() are also connection-state-aware to be consistent.\n\t\t\tfor (const [taskId, clientQueue] of this.taskQueues.entries()) {\n\t\t\t\tif (this.isAttached() && clientQueue[0] === this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All of our outstanding ops will be for the old clientId even if they get ack'd\n\t\t\tthis.latestPendingOps.clear();\n\t\t});\n\t}\n\n\tprivate submitVolunteerOp(taskId: string): void {\n\t\tconst op: ITaskManagerVolunteerOperation = {\n\t\t\ttype: \"volunteer\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"volunteer\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitAbandonOp(taskId: string): void {\n\t\tconst op: ITaskManagerAbandonOperation = {\n\t\t\ttype: \"abandon\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"abandon\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitCompleteOp(taskId: string): void {\n\t\tconst op: ITaskManagerCompletedOperation = {\n\t\t\ttype: \"complete\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"complete\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\n\t\tif (this.pendingCompletedTasks.has(taskId)) {\n\t\t\tthis.pendingCompletedTasks.get(taskId)?.push(pendingOp.messageId);\n\t\t} else {\n\t\t\tthis.pendingCompletedTasks.set(taskId, [pendingOp.messageId]);\n\t\t}\n\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.volunteerForTask}\n\t */\n\tpublic async volunteerForTask(taskId: string): Promise<boolean> {\n\t\t// If we have the lock, resolve immediately\n\t\tif (this.assigned(taskId)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true) {\n\t\t\tconst error =\n\t\t\t\tthis.readOnlyInfo.permissions === true\n\t\t\t\t\t? new Error(\"Attempted to volunteer with read-only permissions\")\n\t\t\t\t\t: new Error(\"Attempted to volunteer in read-only state\");\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x472 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.connected) {\n\t\t\tthrow new Error(\"Attempted to volunteer in disconnected state\");\n\t\t}\n\n\t\t// This promise works even if we already have an outstanding volunteer op.\n\t\tconst lockAcquireP = new Promise<boolean>((resolve, reject) => {\n\t\t\tconst checkIfAcquiredLock = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Also check pending ops here because it's possible we are currently in the queue from a previous\n\t\t\t\t// lock attempt, but have an outstanding abandon AND the outstanding volunteer for this lock attempt.\n\t\t\t\t// If we reach the head of the queue based on the previous lock attempt, we don't want to resolve.\n\t\t\t\tif (this.assigned(taskId) && !this.latestPendingOps.has(taskId)) {\n\t\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\t\tresolve(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Abandoned before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst rejectOnDisconnect = (): void => {\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Disconnected before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\tresolve(false);\n\t\t\t};\n\n\t\t\tthis.queueWatcher.on(\"queueChange\", checkIfAcquiredLock);\n\t\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.on(\"disconnect\", rejectOnDisconnect);\n\t\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\t\t});\n\n\t\tif (!this.queued(taskId)) {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t}\n\t\treturn lockAcquireP;\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribeToTask}\n\t */\n\tpublic subscribeToTask(taskId: string): void {\n\t\tif (this.subscribed(taskId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true && this.readOnlyInfo.permissions === true) {\n\t\t\tthrow new Error(\"Attempted to subscribe with read-only permissions\");\n\t\t}\n\n\t\tconst submitVolunteerOp = (): void => {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t};\n\n\t\tconst disconnectHandler = (): void => {\n\t\t\t// Wait to be connected again and then re-submit volunteer op\n\t\t\tthis.connectionWatcher.once(\"connect\", submitVolunteerOp);\n\t\t};\n\n\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\tthis.connectionWatcher.on(\"disconnect\", disconnectHandler);\n\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x473 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\t// Because we volunteered with placeholderClientId, we need to wait for when we attach and are assigned\n\t\t\t// a real clientId. At that point we should re-enter the queue with a real volunteer op (assuming we are\n\t\t\t// connected).\n\t\t\tthis.runtime.once(\"attached\", () => {\n\t\t\t\tif (this.queued(taskId)) {\n\t\t\t\t\t// If we are already queued, then we were able to replace the placeholderClientId with our real\n\t\t\t\t\t// clientId and no action is required.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.connected) {\n\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t} else {\n\t\t\t\t\tthis.connectionWatcher.once(\"connect\", () => {\n\t\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (!this.connected) {\n\t\t\t// If we are disconnected (and attached), wait to be connected and submit volunteer op\n\t\t\tdisconnectHandler();\n\t\t} else if (!this.assigned(taskId) && !this.queued(taskId)) {\n\t\t\tsubmitVolunteerOp();\n\t\t}\n\t\tthis.subscribedTasks.add(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.abandon}\n\t */\n\tpublic abandon(taskId: string): void {\n\t\t// Always allow abandon if the client is subscribed to allow clients to unsubscribe while disconnected.\n\t\t// Otherwise, we should check to make sure the client is both connected queued for the task before sending an\n\t\t// abandon op.\n\t\tif (!this.subscribed(taskId) && !this.queued(taskId)) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x474 /* clientId is undefined */);\n\t\t\tthis.removeClientFromQueue(taskId, this.clientId);\n\t\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're subscribed but not queued, we don't need to submit an abandon op (probably offline)\n\t\tif (this.queued(taskId)) {\n\t\t\tthis.submitAbandonOp(taskId);\n\t\t}\n\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.assigned}\n\t */\n\tpublic assigned(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentAssignee = this.taskQueues.get(taskId)?.[0];\n\t\treturn (\n\t\t\tcurrentAssignee !== undefined &&\n\t\t\tcurrentAssignee === this.clientId &&\n\t\t\t!this.latestPendingOps.has(taskId)\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.queued}\n\t */\n\tpublic queued(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(this.clientId !== undefined, 0x07f /* \"clientId undefined\" */);\n\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\t// If we have no queue for the taskId, then no one has signed up for it.\n\t\treturn (\n\t\t\t((clientQueue?.includes(this.clientId) ?? false) &&\n\t\t\t\t!this.latestPendingOps.has(taskId)) ||\n\t\t\tthis.latestPendingOps.get(taskId)?.type === \"volunteer\"\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribed}\n\t */\n\tpublic subscribed(taskId: string): boolean {\n\t\treturn this.subscribedTasks.has(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.complete}\n\t */\n\tpublic complete(taskId: string): void {\n\t\tif (!this.assigned(taskId)) {\n\t\t\tthrow new Error(\"Attempted to mark task as complete while not being assigned\");\n\t\t}\n\n\t\t// If we are detached we will simulate auto-ack for the complete op. Therefore we only need to send the op if\n\t\t// we are attached. Additionally, we don't need to check if we are connected while detached.\n\t\tif (this.isAttached()) {\n\t\t\tif (!this.connected) {\n\t\t\t\tthrow new Error(\"Attempted to complete task in disconnected state\");\n\t\t\t}\n\t\t\tthis.submitCompleteOp(taskId);\n\t\t}\n\n\t\tthis.taskQueues.delete(taskId);\n\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\tthis.emit(\"completed\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.canVolunteer}\n\t */\n\tpublic canVolunteer(): boolean {\n\t\t// A client can volunteer for a task if it's both connected to the delta stream and in write mode.\n\t\t// this.connected reflects that condition, but is unintuitive and may be changed in the future. This API allows\n\t\t// us to make changes to this.connected without affecting our guidance on how to check if a client is eligible\n\t\t// to volunteer for a task.\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Create a summary for the task manager\n\t *\n\t * @returns the summary of the current state of the task manager\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tif (this.runtime.clientId === undefined) {\n\t\t\t// If the runtime has still not been assigned a clientId, we should not summarize with the placeholder\n\t\t\t// clientIds and instead remove them from the queues and require the client to re-volunteer when assigned\n\t\t\t// a new clientId.\n\t\t\tthis.removeClientFromAllQueues(placeholderClientId);\n\t\t} else {\n\t\t\t// If the runtime has been assigned an actual clientId by now, we can replace the placeholder clientIds\n\t\t\t// and maintain the task assignment.\n\t\t\tthis.replacePlaceholderInAllQueues();\n\t\t}\n\n\t\t// Only include tasks if there are clients in the queue.\n\t\tconst filteredMap = new Map<string, string[]>();\n\t\tfor (const [taskId, queue] of this.taskQueues) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tfilteredMap.set(taskId, queue);\n\t\t\t}\n\t\t}\n\t\tconst content = [...filteredMap.entries()];\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(content));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst content = await readAndParse<[string, string[]][]>(storage, snapshotFileName);\n\t\tfor (const [taskId, clientIdQueue] of content) {\n\t\t\tthis.taskQueues.set(taskId, clientIdQueue);\n\t\t}\n\t\tthis.scrubClientsNotInQuorum();\n\t}\n\n\t/***/\n\tprotected initializeLocalCore(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {\n\t\tthis.connectionWatcher.emit(\"disconnect\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}\n\t */\n\tprotected onConnect(): void {\n\t\tthis.connectionWatcher.emit(\"connect\");\n\t}\n\n\t//\n\t/**\n\t * Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the\n\t * queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.\n\t */\n\tprotected reSubmitCore(): void {}\n\n\t/**\n\t * Process a task manager operation\n\t *\n\t * @param message - the message to prepare\n\t * @param local - whether the message was sent by the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as ITaskManagerOperation;\n\t\t\tconst messageId = localOpMetadata as number;\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"volunteer\": {\n\t\t\t\t\tthis.opWatcher.emit(\"volunteer\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"abandon\": {\n\t\t\t\t\tthis.opWatcher.emit(\"abandon\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"complete\": {\n\t\t\t\t\tthis.opWatcher.emit(\"complete\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addClientToQueue(taskId: string, clientId: string): void {\n\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\tif (pendingIds !== undefined && pendingIds.length > 0) {\n\t\t\t// Ignore the volunteer op if we know this task is about to be completed\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the clientId exists in the quorum, or it is placeholderClientId (detached scenario)\n\t\tif (\n\t\t\tthis.runtime.getQuorum().getMembers().has(clientId) ||\n\t\t\tthis.clientId === placeholderClientId\n\t\t) {\n\t\t\t// Create the queue if it doesn't exist, and push the client on the back.\n\t\t\tlet clientQueue = this.taskQueues.get(taskId);\n\t\t\tif (clientQueue === undefined) {\n\t\t\t\tclientQueue = [];\n\t\t\t\tthis.taskQueues.set(taskId, clientQueue);\n\t\t\t}\n\n\t\t\tconst oldLockHolder = clientQueue[0];\n\t\t\tclientQueue.push(clientId);\n\t\t\tconst newLockHolder = clientQueue[0];\n\t\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeClientFromQueue(taskId: string, clientId: string): void {\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\tif (clientQueue === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldLockHolder =\n\t\t\tclientId === placeholderClientId ? placeholderClientId : clientQueue[0];\n\t\tconst clientIdIndex = clientQueue.indexOf(clientId);\n\t\tif (clientIdIndex !== -1) {\n\t\t\tclientQueue.splice(clientIdIndex, 1);\n\t\t\t// Clean up the queue if there are no more clients in it.\n\t\t\tif (clientQueue.length === 0) {\n\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t}\n\t\t}\n\t\tconst newLockHolder = clientQueue[0];\n\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t}\n\t}\n\n\tprivate removeClientFromAllQueues(clientId: string): void {\n\t\tfor (const taskId of this.taskQueues.keys()) {\n\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t}\n\t}\n\n\t/**\n\t * Will replace all instances of the placeholderClientId with the current clientId. This should only be called when\n\t * transitioning from detached to attached and this.runtime.clientId is defined.\n\t */\n\tprivate replacePlaceholderInAllQueues(): void {\n\t\tassert(\n\t\t\tthis.runtime.clientId !== undefined,\n\t\t\t0x475 /* this.runtime.clientId should be defined */,\n\t\t);\n\t\tfor (const clientQueue of this.taskQueues.values()) {\n\t\t\tconst clientIdIndex = clientQueue.indexOf(placeholderClientId);\n\t\t\tif (clientIdIndex !== -1) {\n\t\t\t\tclientQueue[clientIdIndex] = this.runtime.clientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This seems like it should be unnecessary if we can trust to receive the join/leave messages and\n\t// also have an accurate snapshot.\n\tprivate scrubClientsNotInQuorum(): void {\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tfor (const [taskId, clientQueue] of this.taskQueues) {\n\t\t\tconst filteredClientQueue = clientQueue.filter(\n\t\t\t\t(clientId) => quorum.getMember(clientId) !== undefined,\n\t\t\t);\n\t\t\tif (clientQueue.length !== filteredClientQueue.length) {\n\t\t\t\tif (filteredClientQueue.length === 0) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t} else {\n\t\t\t\t\tthis.taskQueues.set(taskId, filteredClientQueue);\n\t\t\t\t}\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyStashedOp(content: unknown): void {\n\t\tconst taskOp: ITaskManagerOperation = content as ITaskManagerOperation;\n\t\tswitch (taskOp.type) {\n\t\t\tcase \"abandon\": {\n\t\t\t\tthis.abandon(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"complete\": {\n\t\t\t\tthis.complete(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"volunteer\": {\n\t\t\t\tthis.subscribeToTask(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(taskOp);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -20,14 +20,12 @@ export declare class TaskManagerFactory implements IChannelFactory<ITaskManager>
20
20
  }
21
21
  /**
22
22
  * {@inheritDoc ITaskManager}
23
- * @legacy
24
- * @alpha
23
+ * @legacy @beta
25
24
  */
26
25
  export declare const TaskManager: import("@fluidframework/shared-object-base/internal").ISharedObjectKind<ITaskManager> & import("@fluidframework/shared-object-base/internal").SharedObjectKind<ITaskManager>;
27
26
  /**
28
27
  * {@inheritDoc ITaskManager}
29
- * @legacy
30
- * @alpha
28
+ * @legacy @beta
31
29
  */
32
30
  export type TaskManager = ITaskManager;
33
31
  //# sourceMappingURL=taskManagerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"taskManagerFactory.d.ts","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe,CAAC,YAAY,CAAC;IACvE,gBAAuB,IAAI,oDAAoD;IAE/E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAEhD;IAED,IAAW,UAAU,IAAI,OAAO,kBAAkB,CAAC,UAAU,CAE5D;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAMjB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAKzE;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,8KAA6C,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"taskManagerFactory.d.ts","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe,CAAC,YAAY,CAAC;IACvE,gBAAuB,IAAI,oDAAoD;IAE/E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAEhD;IAED,IAAW,UAAU,IAAI,OAAO,kBAAkB,CAAC,UAAU,CAE5D;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAMjB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAKzE;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,8KAA6C,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC"}
@@ -41,8 +41,7 @@ TaskManagerFactory.Attributes = {
41
41
  };
42
42
  /**
43
43
  * {@inheritDoc ITaskManager}
44
- * @legacy
45
- * @alpha
44
+ * @legacy @beta
46
45
  */
47
46
  exports.TaskManager = (0, internal_1.createSharedObjectKind)(TaskManagerFactory);
48
47
  //# sourceMappingURL=taskManagerFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taskManagerFactory.js","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,qDAAoD;AAEpD;;GAEG;AACH,MAAa,kBAAkB;IAS9B,IAAW,IAAI;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,SAAS,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;;AAnCF,gDAoCC;AAnCuB,uBAAI,GAAG,gDAAgD,CAAC;AAExD,6BAAU,GAAuB;IACvD,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AA+BH;;;;GAIG;AACU,QAAA,WAAW,GAAG,IAAA,iCAAsB,EAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { TaskManagerClass } from \"./taskManager.js\";\n\n/**\n * The factory that defines the task queue\n */\nexport class TaskManagerFactory implements IChannelFactory<ITaskManager> {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/task-manager\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: TaskManagerFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): typeof TaskManagerFactory.Type {\n\t\treturn TaskManagerFactory.Type;\n\t}\n\n\tpublic get attributes(): typeof TaskManagerFactory.Attributes {\n\t\treturn TaskManagerFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ITaskManager> {\n\t\tconst taskQueue = new TaskManagerClass(id, runtime, attributes);\n\t\tawait taskQueue.load(services);\n\t\treturn taskQueue;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ITaskManager {\n\t\tconst taskQueue = new TaskManagerClass(id, document, this.attributes);\n\t\ttaskQueue.initializeLocal();\n\t\treturn taskQueue;\n\t}\n}\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy\n * @alpha\n */\nexport const TaskManager = createSharedObjectKind(TaskManagerFactory);\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy\n * @alpha\n */\nexport type TaskManager = ITaskManager;\n"]}
1
+ {"version":3,"file":"taskManagerFactory.js","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,qDAAoD;AAEpD;;GAEG;AACH,MAAa,kBAAkB;IAS9B,IAAW,IAAI;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,SAAS,GAAG,IAAI,iCAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,SAAS,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;;AAnCF,gDAoCC;AAnCuB,uBAAI,GAAG,gDAAgD,CAAC;AAExD,6BAAU,GAAuB;IACvD,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AA+BH;;;GAGG;AACU,QAAA,WAAW,GAAG,IAAA,iCAAsB,EAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { TaskManagerClass } from \"./taskManager.js\";\n\n/**\n * The factory that defines the task queue\n */\nexport class TaskManagerFactory implements IChannelFactory<ITaskManager> {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/task-manager\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: TaskManagerFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): typeof TaskManagerFactory.Type {\n\t\treturn TaskManagerFactory.Type;\n\t}\n\n\tpublic get attributes(): typeof TaskManagerFactory.Attributes {\n\t\treturn TaskManagerFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ITaskManager> {\n\t\tconst taskQueue = new TaskManagerClass(id, runtime, attributes);\n\t\tawait taskQueue.load(services);\n\t\treturn taskQueue;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ITaskManager {\n\t\tconst taskQueue = new TaskManagerClass(id, document, this.attributes);\n\t\ttaskQueue.initializeLocal();\n\t\treturn taskQueue;\n\t}\n}\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy @beta\n */\nexport const TaskManager = createSharedObjectKind(TaskManagerFactory);\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy @beta\n */\nexport type TaskManager = ITaskManager;\n"]}
@@ -7,14 +7,12 @@ import type { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-
7
7
  * Describes the event listener format for {@link ITaskManagerEvents} events.
8
8
  *
9
9
  * @param taskId - The unique identifier of the related task.
10
- * @legacy
11
- * @alpha
10
+ * @legacy @beta
12
11
  */
13
12
  export type TaskEventListener = (taskId: string) => void;
14
13
  /**
15
14
  * Events emitted by {@link ITaskManager}.
16
- * @legacy
17
- * @alpha
15
+ * @legacy @beta
18
16
  */
19
17
  export interface ITaskManagerEvents extends ISharedObjectEvents {
20
18
  /**
@@ -129,8 +127,7 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
129
127
  * when using {@link ITaskManager.subscribeToTask}.
130
128
  *
131
129
  * See {@link ITaskManagerEvents} for more details.
132
- * @legacy
133
- * @alpha
130
+ * @legacy @beta
134
131
  */
135
132
  export interface ITaskManager extends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AAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * Describes the event listener format for {@link ITaskManagerEvents} events.\n *\n * @param taskId - The unique identifier of the related task.\n * @legacy\n * @alpha\n */\nexport type TaskEventListener = (taskId: string) => void;\n\n/**\n * Events emitted by {@link ITaskManager}.\n * @legacy\n * @alpha\n */\nexport interface ITaskManagerEvents extends ISharedObjectEvents {\n\t/**\n\t * Fires when a task has been exclusively assigned to the client.\n\t *\n\t * @remarks Does not account for known pending ops, but instead only reflects the current state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"assigned\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when a task the client is queued for is completed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"completed\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when the task assignment is lost by the local client.\n\t *\n\t * @remarks This could be due to the client disconnecting or by manually calling {@link ITaskManager.abandon}.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"lost\", listener: TaskEventListener);\n}\n\n/**\n * A distributed data structure that tracks queues of clients that want to exclusively run a task.\n *\n * @example Creation\n *\n * To create a {@link ITaskManager}, call the static create method:\n *\n * ```typescript\n * const taskManager = TaskManager.create(this.runtime, id);\n * ```\n *\n * @example Usage\n *\n * To volunteer for a task, use the {@link ITaskManager.volunteerForTask} method.\n * This returns a Promise that will resolve once the client has acquired exclusive rights to run the task,\n * or reject if the client is removed from the queue without acquiring the rights.\n *\n * ```typescript\n * taskManager.volunteerForTask(\"NameOfTask\")\n * .then(() => { doTheTask(); })\n * .catch((err) => { console.error(err); });\n * ```\n *\n * Alternatively, you can indefinitely volunteer for a task with the synchronous {@link ITaskManager.subscribeToTask}\n * method. This method does not return a value, therefore you need to rely on eventing to know when you have acquired\n * the rights to run the task (see below).\n *\n * ```typescript\n * taskManager.subscribeToTask(\"NameOfTask\");\n * ```\n *\n * To check if the local client is currently subscribed to a task, use the {@link ITaskManager.subscribed} method.\n *\n * ```typescript\n * if (taskManager.subscribed(\"NameOfTask\")) {\n * console.log(\"This client is currently subscribed to the task.\");\n * }\n * ```\n *\n * To release the rights to the task, use the {@link ITaskManager.abandon} method.\n * The next client in the queue will then get the rights to run the task.\n *\n * ```typescript\n * taskManager.abandon(\"NameOfTask\");\n * ```\n *\n * To inspect your state in the queue, you can use the {@link ITaskManager.queued} and {@link ITaskManager.assigned}\n * methods.\n *\n * ```typescript\n * if (taskManager.queued(\"NameOfTask\")) {\n * console.log(\"This client is somewhere in the queue, potentially even having the task assignment.\");\n * }\n *\n * if (taskManager.assigned(\"NameOfTask\")) {\n * console.log(\"This client currently has the rights to run the task\");\n * }\n * ```\n *\n * To signal to other connected clients that a task is completed, use the {@link ITaskManager.complete} method.\n * This will release all clients from the queue and emit the \"completed\" event.\n *\n * ```typescript\n * taskManager.complete(\"NameOfTask\");\n * ```\n *\n * @example Eventing\n *\n * `ITaskManager` will emit events when a task is assigned to the client, when the task assignment is lost,\n * and when a task was completed by another client.\n *\n * ```typescript\n * taskManager.on(\"assigned\", (taskId: string) => {\n * console.log(`Client was assigned task: ${taskId}`);\n * });\n *\n * taskManager.on(\"lost\", (taskId: string) => {\n * console.log(`Client released task: ${taskId}`);\n * });\n *\n * taskManager.on(\"completed\", (taskId: string) => {\n * console.log(`Another client completed task: ${taskId}`);\n * });\n * ```\n *\n * These can be useful if the logic to volunteer for a task is separated from the logic to perform the task, such as\n * when using {@link ITaskManager.subscribeToTask}.\n *\n * See {@link ITaskManagerEvents} for more details.\n * @legacy\n * @alpha\n */\nexport interface ITaskManager extends ISharedObject<ITaskManagerEvents> {\n\t/**\n\t * Volunteer for the task. Returns a promise that resolves `true` if the task is assigned to the local client and\n\t * `false` if the task was completed by another client. It rejects if the local client abandoned the task or\n\t * disconnected while in queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tvolunteerForTask(taskId: string): Promise<boolean>;\n\n\t/**\n\t * Continuously volunteer for the task. Watch the \"assigned\" event to determine if the task is assigned.\n\t * The local client will automatically re-enter the queue if it disconnects.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribeToTask(taskId: string): void;\n\n\t/**\n\t * Exit the queue, releasing the task if currently assigned.\n\t * @param taskId - Identifier for the task\n\t */\n\tabandon(taskId: string): void;\n\n\t/**\n\t * Check whether this client is the current assignee for the task and there is no outstanding abandon op that\n\t * would abandon the assignment.\n\t * @param taskId - Identifier for the task\n\t */\n\tassigned(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is either the current assignee, in queue, or we expect they will be in queue after\n\t * outstanding ops have been ack'd.\n\t * @param taskId - Identifier for the task\n\t */\n\tqueued(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is currently subscribed to the task.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribed(taskId: string): boolean;\n\n\t/**\n\t * Marks a task as completed and releases all clients from its queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tcomplete(taskId: string): void;\n\n\t/**\n\t * Check whether this client can currently volunteer for a task.\n\t */\n\tcanVolunteer(): boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * Describes the event listener format for {@link ITaskManagerEvents} events.\n *\n * @param taskId - The unique identifier of the related task.\n * @legacy @beta\n */\nexport type TaskEventListener = (taskId: string) => void;\n\n/**\n * Events emitted by {@link ITaskManager}.\n * @legacy @beta\n */\nexport interface ITaskManagerEvents extends ISharedObjectEvents {\n\t/**\n\t * Fires when a task has been exclusively assigned to the client.\n\t *\n\t * @remarks Does not account for known pending ops, but instead only reflects the current state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"assigned\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when a task the client is queued for is completed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"completed\", listener: TaskEventListener);\n\n\t/**\n\t * Fires when the task assignment is lost by the local client.\n\t *\n\t * @remarks This could be due to the client disconnecting or by manually calling {@link ITaskManager.abandon}.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"lost\", listener: TaskEventListener);\n}\n\n/**\n * A distributed data structure that tracks queues of clients that want to exclusively run a task.\n *\n * @example Creation\n *\n * To create a {@link ITaskManager}, call the static create method:\n *\n * ```typescript\n * const taskManager = TaskManager.create(this.runtime, id);\n * ```\n *\n * @example Usage\n *\n * To volunteer for a task, use the {@link ITaskManager.volunteerForTask} method.\n * This returns a Promise that will resolve once the client has acquired exclusive rights to run the task,\n * or reject if the client is removed from the queue without acquiring the rights.\n *\n * ```typescript\n * taskManager.volunteerForTask(\"NameOfTask\")\n * .then(() => { doTheTask(); })\n * .catch((err) => { console.error(err); });\n * ```\n *\n * Alternatively, you can indefinitely volunteer for a task with the synchronous {@link ITaskManager.subscribeToTask}\n * method. This method does not return a value, therefore you need to rely on eventing to know when you have acquired\n * the rights to run the task (see below).\n *\n * ```typescript\n * taskManager.subscribeToTask(\"NameOfTask\");\n * ```\n *\n * To check if the local client is currently subscribed to a task, use the {@link ITaskManager.subscribed} method.\n *\n * ```typescript\n * if (taskManager.subscribed(\"NameOfTask\")) {\n * console.log(\"This client is currently subscribed to the task.\");\n * }\n * ```\n *\n * To release the rights to the task, use the {@link ITaskManager.abandon} method.\n * The next client in the queue will then get the rights to run the task.\n *\n * ```typescript\n * taskManager.abandon(\"NameOfTask\");\n * ```\n *\n * To inspect your state in the queue, you can use the {@link ITaskManager.queued} and {@link ITaskManager.assigned}\n * methods.\n *\n * ```typescript\n * if (taskManager.queued(\"NameOfTask\")) {\n * console.log(\"This client is somewhere in the queue, potentially even having the task assignment.\");\n * }\n *\n * if (taskManager.assigned(\"NameOfTask\")) {\n * console.log(\"This client currently has the rights to run the task\");\n * }\n * ```\n *\n * To signal to other connected clients that a task is completed, use the {@link ITaskManager.complete} method.\n * This will release all clients from the queue and emit the \"completed\" event.\n *\n * ```typescript\n * taskManager.complete(\"NameOfTask\");\n * ```\n *\n * @example Eventing\n *\n * `ITaskManager` will emit events when a task is assigned to the client, when the task assignment is lost,\n * and when a task was completed by another client.\n *\n * ```typescript\n * taskManager.on(\"assigned\", (taskId: string) => {\n * console.log(`Client was assigned task: ${taskId}`);\n * });\n *\n * taskManager.on(\"lost\", (taskId: string) => {\n * console.log(`Client released task: ${taskId}`);\n * });\n *\n * taskManager.on(\"completed\", (taskId: string) => {\n * console.log(`Another client completed task: ${taskId}`);\n * });\n * ```\n *\n * These can be useful if the logic to volunteer for a task is separated from the logic to perform the task, such as\n * when using {@link ITaskManager.subscribeToTask}.\n *\n * See {@link ITaskManagerEvents} for more details.\n * @legacy @beta\n */\nexport interface ITaskManager extends ISharedObject<ITaskManagerEvents> {\n\t/**\n\t * Volunteer for the task. Returns a promise that resolves `true` if the task is assigned to the local client and\n\t * `false` if the task was completed by another client. It rejects if the local client abandoned the task or\n\t * disconnected while in queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tvolunteerForTask(taskId: string): Promise<boolean>;\n\n\t/**\n\t * Continuously volunteer for the task. Watch the \"assigned\" event to determine if the task is assigned.\n\t * The local client will automatically re-enter the queue if it disconnects.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribeToTask(taskId: string): void;\n\n\t/**\n\t * Exit the queue, releasing the task if currently assigned.\n\t * @param taskId - Identifier for the task\n\t */\n\tabandon(taskId: string): void;\n\n\t/**\n\t * Check whether this client is the current assignee for the task and there is no outstanding abandon op that\n\t * would abandon the assignment.\n\t * @param taskId - Identifier for the task\n\t */\n\tassigned(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is either the current assignee, in queue, or we expect they will be in queue after\n\t * outstanding ops have been ack'd.\n\t * @param taskId - Identifier for the task\n\t */\n\tqueued(taskId: string): boolean;\n\n\t/**\n\t * Check whether this client is currently subscribed to the task.\n\t * @param taskId - Identifier for the task\n\t */\n\tsubscribed(taskId: string): boolean;\n\n\t/**\n\t * Marks a task as completed and releases all clients from its queue.\n\t * @param taskId - Identifier for the task\n\t */\n\tcomplete(taskId: string): void;\n\n\t/**\n\t * Check whether this client can currently volunteer for a task.\n\t */\n\tcanVolunteer(): boolean;\n}\n"]}
@@ -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/task-manager";
8
- export declare const pkgVersion = "2.53.0";
8
+ export declare const pkgVersion = "2.60.0";
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/task-manager";
8
- export const pkgVersion = "2.53.0";
8
+ export const pkgVersion = "2.60.0";
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,QAAQ,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/task-manager\";\nexport const pkgVersion = \"2.53.0\";\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,QAAQ,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/task-manager\";\nexport const pkgVersion = \"2.60.0\";\n"]}
@@ -12,8 +12,7 @@ import type { ITaskManager, ITaskManagerEvents } from "./interfaces.js";
12
12
  * {@inheritDoc ITaskManager}
13
13
  *
14
14
  * @sealed
15
- * @legacy
16
- * @alpha
15
+ * @legacy @beta
17
16
  */
18
17
  export declare class TaskManagerClass extends SharedObject<ITaskManagerEvents> implements ITaskManager {
19
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taskManager.d.ts","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAG7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EACN,YAAY,EAEZ,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAqCxE;;;;;;GAMG;AACH,qBAAa,gBACZ,SAAQ,YAAY,CAAC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E,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,IAAI,IAAI;IAErC;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,IAAI;IAK3B;;;OAGG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,OAAO,GACtB,IAAI;IA6BP,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,yBAAyB;IAMjC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAerC,OAAO,CAAC,uBAAuB;IAiB/B,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAoBhD"}
@@ -16,8 +16,7 @@ const placeholderClientId = "placeholder";
16
16
  * {@inheritDoc ITaskManager}
17
17
  *
18
18
  * @sealed
19
- * @legacy
20
- * @alpha
19
+ * @legacy @beta
21
20
  */
22
21
  export class TaskManagerClass extends SharedObject {
23
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taskManager.js","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAO9E,OA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AC;YACF,IAAI,WAAW,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,EAAE,CAAC;gBACvD,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACtC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACP,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;gBAClD,CAAC;gBACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAC/C,CAAC;QACF,CAAC;IACF,CAAC;IAES,cAAc,CAAC,OAAgB;QACxC,MAAM,MAAM,GAA0B,OAAgC,CAAC;QACvE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,SAAS,CAAC,CAAC,CAAC;gBAChB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC5B,MAAM;YACP,CAAC;YACD,KAAK,UAAU,CAAC,CAAC,CAAC;gBACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC7B,MAAM;YACP,CAAC;YACD,KAAK,WAAW,CAAC,CAAC,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACpC,MAAM;YACP,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,eAAe,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ReadOnlyInfo } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager, ITaskManagerEvents } from \"./interfaces.js\";\n\n/**\n * Description of a task manager operation\n */\ntype ITaskManagerOperation =\n\t| ITaskManagerVolunteerOperation\n\t| ITaskManagerAbandonOperation\n\t| ITaskManagerCompletedOperation;\n\ninterface ITaskManagerVolunteerOperation {\n\ttype: \"volunteer\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerAbandonOperation {\n\ttype: \"abandon\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerCompletedOperation {\n\ttype: \"complete\";\n\ttaskId: string;\n}\n\ninterface IPendingOp {\n\ttype: \"volunteer\" | \"abandon\" | \"complete\";\n\tmessageId: number;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * Placeholder clientId for detached scenarios.\n */\nconst placeholderClientId = \"placeholder\";\n\n/**\n * {@inheritDoc ITaskManager}\n *\n * @sealed\n * @legacy\n * @alpha\n */\nexport class TaskManagerClass\n\textends SharedObject<ITaskManagerEvents>\n\timplements ITaskManager\n{\n\t/**\n\t * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the\n\t * queue, even if we know we've submitted an op that should eventually modify the queue.\n\t */\n\tprivate readonly taskQueues = new Map<string, string[]>();\n\n\t// opWatcher emits for every op on this data store. This is just a repackaging of processCore into events.\n\tprivate readonly opWatcher: EventEmitter = new EventEmitter();\n\t// queueWatcher emits an event whenever the consensus state of the task queues changes\n\tprivate readonly queueWatcher: EventEmitter = new EventEmitter();\n\t// abandonWatcher emits an event whenever the local client calls abandon() on a task.\n\tprivate readonly abandonWatcher: EventEmitter = new EventEmitter();\n\t// connectionWatcher emits an event whenever we get connected or disconnected.\n\tprivate readonly connectionWatcher: EventEmitter = new EventEmitter();\n\t// completedWatcher emits an event whenever the local client receives a completed op.\n\tprivate readonly completedWatcher: EventEmitter = new EventEmitter();\n\n\tprivate messageId: number = -1;\n\t/**\n\t * Tracks the most recent pending op for a given task\n\t */\n\tprivate readonly latestPendingOps = new Map<string, IPendingOp>();\n\n\t/**\n\t * Tracks tasks that are this client is currently subscribed to.\n\t */\n\tprivate readonly subscribedTasks = new Set<string>();\n\n\t/**\n\t * Map to track tasks that have pending complete ops.\n\t */\n\tprivate readonly pendingCompletedTasks = new Map<string, number[]>();\n\n\t/**\n\t * Returns the clientId. Will return a placeholder if the runtime is detached and not yet assigned a clientId.\n\t */\n\tprivate get clientId(): string | undefined {\n\t\treturn this.isAttached() ? this.runtime.clientId : placeholderClientId;\n\t}\n\n\t/**\n\t * Returns a ReadOnlyInfo object to determine current read/write permissions.\n\t */\n\tprivate get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\t/**\n\t * Constructs a new task manager. If the object is non-local an id and service interfaces will\n\t * be provided\n\t *\n\t * @param runtime - data store runtime the task queue belongs to\n\t * @param id - optional name of the task queue\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_taskManager_\");\n\n\t\tthis.opWatcher.on(\n\t\t\t\"volunteer\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\t// We're tracking local ops from this connection. Filter out local ops during \"connecting\"\n\t\t\t\t// state since these were sent on the prior connection and were already cleared from the latestPendingOps.\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07b /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to volunteer and abandon multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"volunteer\", 0x07c /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.addClientToQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"abandon\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07d /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to abandon and volunteer multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"abandon\", 0x07e /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"complete\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x400 /* Unexpected op */);\n\t\t\t\t\t// Need to check the id, since it's possible to complete multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"complete\", 0x401 /* Unexpected op type */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove complete op from this.pendingCompletedTasks\n\t\t\t\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tpendingIds !== undefined && pendingIds.length > 0,\n\t\t\t\t\t\t0x402 /* pendingIds is empty */,\n\t\t\t\t\t);\n\t\t\t\t\tconst removed = pendingIds.shift();\n\t\t\t\t\tassert(removed === messageId, 0x403 /* Removed complete op id does not match */);\n\t\t\t\t}\n\n\t\t\t\t// For clients in queue, we need to remove them from the queue and raise the proper events.\n\t\t\t\tif (!local) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\t\t\t\tthis.emit(\"completed\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\truntime.getQuorum().on(\"removeMember\", (clientId: string) => {\n\t\t\tthis.removeClientFromAllQueues(clientId);\n\t\t});\n\n\t\tthis.queueWatcher.on(\n\t\t\t\"queueChange\",\n\t\t\t(taskId: string, oldLockHolder: string, newLockHolder: string) => {\n\t\t\t\t// If oldLockHolder is placeholderClientId we need to emit the task was lost during the attach process\n\t\t\t\tif (oldLockHolder === placeholderClientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Exit early if we are still catching up on reconnect -- we can't be the leader yet anyway.\n\t\t\t\tif (this.clientId === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (oldLockHolder !== this.clientId && newLockHolder === this.clientId) {\n\t\t\t\t\tthis.emit(\"assigned\", taskId);\n\t\t\t\t} else if (oldLockHolder === this.clientId && newLockHolder !== this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tthis.connectionWatcher.on(\"disconnect\", () => {\n\t\t\tassert(this.clientId !== undefined, 0x1d3 /* \"Missing client id on disconnect\" */);\n\n\t\t\t// We don't modify the taskQueues on disconnect (they still reflect the latest known consensus state).\n\t\t\t// After reconnect these will get cleaned up by observing the clientLeaves.\n\t\t\t// However we do need to recognize that we lost the lock if we had it. Calls to .queued() and\n\t\t\t// .assigned() are also connection-state-aware to be consistent.\n\t\t\tfor (const [taskId, clientQueue] of this.taskQueues.entries()) {\n\t\t\t\tif (this.isAttached() && clientQueue[0] === this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All of our outstanding ops will be for the old clientId even if they get ack'd\n\t\t\tthis.latestPendingOps.clear();\n\t\t});\n\t}\n\n\tprivate submitVolunteerOp(taskId: string): void {\n\t\tconst op: ITaskManagerVolunteerOperation = {\n\t\t\ttype: \"volunteer\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"volunteer\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitAbandonOp(taskId: string): void {\n\t\tconst op: ITaskManagerAbandonOperation = {\n\t\t\ttype: \"abandon\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"abandon\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitCompleteOp(taskId: string): void {\n\t\tconst op: ITaskManagerCompletedOperation = {\n\t\t\ttype: \"complete\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"complete\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\n\t\tif (this.pendingCompletedTasks.has(taskId)) {\n\t\t\tthis.pendingCompletedTasks.get(taskId)?.push(pendingOp.messageId);\n\t\t} else {\n\t\t\tthis.pendingCompletedTasks.set(taskId, [pendingOp.messageId]);\n\t\t}\n\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.volunteerForTask}\n\t */\n\tpublic async volunteerForTask(taskId: string): Promise<boolean> {\n\t\t// If we have the lock, resolve immediately\n\t\tif (this.assigned(taskId)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true) {\n\t\t\tconst error =\n\t\t\t\tthis.readOnlyInfo.permissions === true\n\t\t\t\t\t? new Error(\"Attempted to volunteer with read-only permissions\")\n\t\t\t\t\t: new Error(\"Attempted to volunteer in read-only state\");\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x472 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.connected) {\n\t\t\tthrow new Error(\"Attempted to volunteer in disconnected state\");\n\t\t}\n\n\t\t// This promise works even if we already have an outstanding volunteer op.\n\t\tconst lockAcquireP = new Promise<boolean>((resolve, reject) => {\n\t\t\tconst checkIfAcquiredLock = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Also check pending ops here because it's possible we are currently in the queue from a previous\n\t\t\t\t// lock attempt, but have an outstanding abandon AND the outstanding volunteer for this lock attempt.\n\t\t\t\t// If we reach the head of the queue based on the previous lock attempt, we don't want to resolve.\n\t\t\t\tif (this.assigned(taskId) && !this.latestPendingOps.has(taskId)) {\n\t\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\t\tresolve(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Abandoned before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst rejectOnDisconnect = (): void => {\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Disconnected before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\tresolve(false);\n\t\t\t};\n\n\t\t\tthis.queueWatcher.on(\"queueChange\", checkIfAcquiredLock);\n\t\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.on(\"disconnect\", rejectOnDisconnect);\n\t\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\t\t});\n\n\t\tif (!this.queued(taskId)) {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t}\n\t\treturn lockAcquireP;\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribeToTask}\n\t */\n\tpublic subscribeToTask(taskId: string): void {\n\t\tif (this.subscribed(taskId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true && this.readOnlyInfo.permissions === true) {\n\t\t\tthrow new Error(\"Attempted to subscribe with read-only permissions\");\n\t\t}\n\n\t\tconst submitVolunteerOp = (): void => {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t};\n\n\t\tconst disconnectHandler = (): void => {\n\t\t\t// Wait to be connected again and then re-submit volunteer op\n\t\t\tthis.connectionWatcher.once(\"connect\", submitVolunteerOp);\n\t\t};\n\n\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\tthis.connectionWatcher.on(\"disconnect\", disconnectHandler);\n\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x473 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\t// Because we volunteered with placeholderClientId, we need to wait for when we attach and are assigned\n\t\t\t// a real clientId. At that point we should re-enter the queue with a real volunteer op (assuming we are\n\t\t\t// connected).\n\t\t\tthis.runtime.once(\"attached\", () => {\n\t\t\t\tif (this.queued(taskId)) {\n\t\t\t\t\t// If we are already queued, then we were able to replace the placeholderClientId with our real\n\t\t\t\t\t// clientId and no action is required.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.connected) {\n\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t} else {\n\t\t\t\t\tthis.connectionWatcher.once(\"connect\", () => {\n\t\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (!this.connected) {\n\t\t\t// If we are disconnected (and attached), wait to be connected and submit volunteer op\n\t\t\tdisconnectHandler();\n\t\t} else if (!this.assigned(taskId) && !this.queued(taskId)) {\n\t\t\tsubmitVolunteerOp();\n\t\t}\n\t\tthis.subscribedTasks.add(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.abandon}\n\t */\n\tpublic abandon(taskId: string): void {\n\t\t// Always allow abandon if the client is subscribed to allow clients to unsubscribe while disconnected.\n\t\t// Otherwise, we should check to make sure the client is both connected queued for the task before sending an\n\t\t// abandon op.\n\t\tif (!this.subscribed(taskId) && !this.queued(taskId)) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x474 /* clientId is undefined */);\n\t\t\tthis.removeClientFromQueue(taskId, this.clientId);\n\t\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're subscribed but not queued, we don't need to submit an abandon op (probably offline)\n\t\tif (this.queued(taskId)) {\n\t\t\tthis.submitAbandonOp(taskId);\n\t\t}\n\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.assigned}\n\t */\n\tpublic assigned(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentAssignee = this.taskQueues.get(taskId)?.[0];\n\t\treturn (\n\t\t\tcurrentAssignee !== undefined &&\n\t\t\tcurrentAssignee === this.clientId &&\n\t\t\t!this.latestPendingOps.has(taskId)\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.queued}\n\t */\n\tpublic queued(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(this.clientId !== undefined, 0x07f /* \"clientId undefined\" */);\n\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\t// If we have no queue for the taskId, then no one has signed up for it.\n\t\treturn (\n\t\t\t((clientQueue?.includes(this.clientId) ?? false) &&\n\t\t\t\t!this.latestPendingOps.has(taskId)) ||\n\t\t\tthis.latestPendingOps.get(taskId)?.type === \"volunteer\"\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribed}\n\t */\n\tpublic subscribed(taskId: string): boolean {\n\t\treturn this.subscribedTasks.has(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.complete}\n\t */\n\tpublic complete(taskId: string): void {\n\t\tif (!this.assigned(taskId)) {\n\t\t\tthrow new Error(\"Attempted to mark task as complete while not being assigned\");\n\t\t}\n\n\t\t// If we are detached we will simulate auto-ack for the complete op. Therefore we only need to send the op if\n\t\t// we are attached. Additionally, we don't need to check if we are connected while detached.\n\t\tif (this.isAttached()) {\n\t\t\tif (!this.connected) {\n\t\t\t\tthrow new Error(\"Attempted to complete task in disconnected state\");\n\t\t\t}\n\t\t\tthis.submitCompleteOp(taskId);\n\t\t}\n\n\t\tthis.taskQueues.delete(taskId);\n\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\tthis.emit(\"completed\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.canVolunteer}\n\t */\n\tpublic canVolunteer(): boolean {\n\t\t// A client can volunteer for a task if it's both connected to the delta stream and in write mode.\n\t\t// this.connected reflects that condition, but is unintuitive and may be changed in the future. This API allows\n\t\t// us to make changes to this.connected without affecting our guidance on how to check if a client is eligible\n\t\t// to volunteer for a task.\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Create a summary for the task manager\n\t *\n\t * @returns the summary of the current state of the task manager\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tif (this.runtime.clientId === undefined) {\n\t\t\t// If the runtime has still not been assigned a clientId, we should not summarize with the placeholder\n\t\t\t// clientIds and instead remove them from the queues and require the client to re-volunteer when assigned\n\t\t\t// a new clientId.\n\t\t\tthis.removeClientFromAllQueues(placeholderClientId);\n\t\t} else {\n\t\t\t// If the runtime has been assigned an actual clientId by now, we can replace the placeholder clientIds\n\t\t\t// and maintain the task assignment.\n\t\t\tthis.replacePlaceholderInAllQueues();\n\t\t}\n\n\t\t// Only include tasks if there are clients in the queue.\n\t\tconst filteredMap = new Map<string, string[]>();\n\t\tfor (const [taskId, queue] of this.taskQueues) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tfilteredMap.set(taskId, queue);\n\t\t\t}\n\t\t}\n\t\tconst content = [...filteredMap.entries()];\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(content));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst content = await readAndParse<[string, string[]][]>(storage, snapshotFileName);\n\t\tfor (const [taskId, clientIdQueue] of content) {\n\t\t\tthis.taskQueues.set(taskId, clientIdQueue);\n\t\t}\n\t\tthis.scrubClientsNotInQuorum();\n\t}\n\n\t/***/\n\tprotected initializeLocalCore(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {\n\t\tthis.connectionWatcher.emit(\"disconnect\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}\n\t */\n\tprotected onConnect(): void {\n\t\tthis.connectionWatcher.emit(\"connect\");\n\t}\n\n\t//\n\t/**\n\t * Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the\n\t * queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.\n\t */\n\tprotected reSubmitCore(): void {}\n\n\t/**\n\t * Process a task manager operation\n\t *\n\t * @param message - the message to prepare\n\t * @param local - whether the message was sent by the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as ITaskManagerOperation;\n\t\t\tconst messageId = localOpMetadata as number;\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"volunteer\": {\n\t\t\t\t\tthis.opWatcher.emit(\"volunteer\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"abandon\": {\n\t\t\t\t\tthis.opWatcher.emit(\"abandon\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"complete\": {\n\t\t\t\t\tthis.opWatcher.emit(\"complete\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addClientToQueue(taskId: string, clientId: string): void {\n\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\tif (pendingIds !== undefined && pendingIds.length > 0) {\n\t\t\t// Ignore the volunteer op if we know this task is about to be completed\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the clientId exists in the quorum, or it is placeholderClientId (detached scenario)\n\t\tif (\n\t\t\tthis.runtime.getQuorum().getMembers().has(clientId) ||\n\t\t\tthis.clientId === placeholderClientId\n\t\t) {\n\t\t\t// Create the queue if it doesn't exist, and push the client on the back.\n\t\t\tlet clientQueue = this.taskQueues.get(taskId);\n\t\t\tif (clientQueue === undefined) {\n\t\t\t\tclientQueue = [];\n\t\t\t\tthis.taskQueues.set(taskId, clientQueue);\n\t\t\t}\n\n\t\t\tconst oldLockHolder = clientQueue[0];\n\t\t\tclientQueue.push(clientId);\n\t\t\tconst newLockHolder = clientQueue[0];\n\t\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeClientFromQueue(taskId: string, clientId: string): void {\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\tif (clientQueue === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldLockHolder =\n\t\t\tclientId === placeholderClientId ? placeholderClientId : clientQueue[0];\n\t\tconst clientIdIndex = clientQueue.indexOf(clientId);\n\t\tif (clientIdIndex !== -1) {\n\t\t\tclientQueue.splice(clientIdIndex, 1);\n\t\t\t// Clean up the queue if there are no more clients in it.\n\t\t\tif (clientQueue.length === 0) {\n\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t}\n\t\t}\n\t\tconst newLockHolder = clientQueue[0];\n\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t}\n\t}\n\n\tprivate removeClientFromAllQueues(clientId: string): void {\n\t\tfor (const taskId of this.taskQueues.keys()) {\n\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t}\n\t}\n\n\t/**\n\t * Will replace all instances of the placeholderClientId with the current clientId. This should only be called when\n\t * transitioning from detached to attached and this.runtime.clientId is defined.\n\t */\n\tprivate replacePlaceholderInAllQueues(): void {\n\t\tassert(\n\t\t\tthis.runtime.clientId !== undefined,\n\t\t\t0x475 /* this.runtime.clientId should be defined */,\n\t\t);\n\t\tfor (const clientQueue of this.taskQueues.values()) {\n\t\t\tconst clientIdIndex = clientQueue.indexOf(placeholderClientId);\n\t\t\tif (clientIdIndex !== -1) {\n\t\t\t\tclientQueue[clientIdIndex] = this.runtime.clientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This seems like it should be unnecessary if we can trust to receive the join/leave messages and\n\t// also have an accurate snapshot.\n\tprivate scrubClientsNotInQuorum(): void {\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tfor (const [taskId, clientQueue] of this.taskQueues) {\n\t\t\tconst filteredClientQueue = clientQueue.filter(\n\t\t\t\t(clientId) => quorum.getMember(clientId) !== undefined,\n\t\t\t);\n\t\t\tif (clientQueue.length !== filteredClientQueue.length) {\n\t\t\t\tif (filteredClientQueue.length === 0) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t} else {\n\t\t\t\t\tthis.taskQueues.set(taskId, filteredClientQueue);\n\t\t\t\t}\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyStashedOp(content: unknown): void {\n\t\tconst taskOp: ITaskManagerOperation = content as ITaskManagerOperation;\n\t\tswitch (taskOp.type) {\n\t\t\tcase \"abandon\": {\n\t\t\t\tthis.abandon(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"complete\": {\n\t\t\t\tthis.complete(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"volunteer\": {\n\t\t\t\tthis.subscribeToTask(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(taskOp);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"taskManager.js","sourceRoot":"","sources":["../src/taskManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAO9E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAGrE,OAAO,EACN,YAAY,EACZ,uBAAuB,GACvB,MAAM,6CAA6C,CAAC;AAgCrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,gBACZ,SAAQ,YAAgC;IAoCxC;;OAEG;IACH,IAAY,QAAQ;QACnB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,IAAY,YAAY;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACH,YACC,EAAU,EACV,OAA+B,EAC/B,UAA8B;QAE9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,oBA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B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC7B,MAAM;YACP,CAAC;YACD,KAAK,WAAW,CAAC,CAAC,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACpC,MAAM;YACP,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,eAAe,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ReadOnlyInfo } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager, ITaskManagerEvents } from \"./interfaces.js\";\n\n/**\n * Description of a task manager operation\n */\ntype ITaskManagerOperation =\n\t| ITaskManagerVolunteerOperation\n\t| ITaskManagerAbandonOperation\n\t| ITaskManagerCompletedOperation;\n\ninterface ITaskManagerVolunteerOperation {\n\ttype: \"volunteer\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerAbandonOperation {\n\ttype: \"abandon\";\n\ttaskId: string;\n}\n\ninterface ITaskManagerCompletedOperation {\n\ttype: \"complete\";\n\ttaskId: string;\n}\n\ninterface IPendingOp {\n\ttype: \"volunteer\" | \"abandon\" | \"complete\";\n\tmessageId: number;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * Placeholder clientId for detached scenarios.\n */\nconst placeholderClientId = \"placeholder\";\n\n/**\n * {@inheritDoc ITaskManager}\n *\n * @sealed\n * @legacy @beta\n */\nexport class TaskManagerClass\n\textends SharedObject<ITaskManagerEvents>\n\timplements ITaskManager\n{\n\t/**\n\t * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the\n\t * queue, even if we know we've submitted an op that should eventually modify the queue.\n\t */\n\tprivate readonly taskQueues = new Map<string, string[]>();\n\n\t// opWatcher emits for every op on this data store. This is just a repackaging of processCore into events.\n\tprivate readonly opWatcher: EventEmitter = new EventEmitter();\n\t// queueWatcher emits an event whenever the consensus state of the task queues changes\n\tprivate readonly queueWatcher: EventEmitter = new EventEmitter();\n\t// abandonWatcher emits an event whenever the local client calls abandon() on a task.\n\tprivate readonly abandonWatcher: EventEmitter = new EventEmitter();\n\t// connectionWatcher emits an event whenever we get connected or disconnected.\n\tprivate readonly connectionWatcher: EventEmitter = new EventEmitter();\n\t// completedWatcher emits an event whenever the local client receives a completed op.\n\tprivate readonly completedWatcher: EventEmitter = new EventEmitter();\n\n\tprivate messageId: number = -1;\n\t/**\n\t * Tracks the most recent pending op for a given task\n\t */\n\tprivate readonly latestPendingOps = new Map<string, IPendingOp>();\n\n\t/**\n\t * Tracks tasks that are this client is currently subscribed to.\n\t */\n\tprivate readonly subscribedTasks = new Set<string>();\n\n\t/**\n\t * Map to track tasks that have pending complete ops.\n\t */\n\tprivate readonly pendingCompletedTasks = new Map<string, number[]>();\n\n\t/**\n\t * Returns the clientId. Will return a placeholder if the runtime is detached and not yet assigned a clientId.\n\t */\n\tprivate get clientId(): string | undefined {\n\t\treturn this.isAttached() ? this.runtime.clientId : placeholderClientId;\n\t}\n\n\t/**\n\t * Returns a ReadOnlyInfo object to determine current read/write permissions.\n\t */\n\tprivate get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\t/**\n\t * Constructs a new task manager. If the object is non-local an id and service interfaces will\n\t * be provided\n\t *\n\t * @param runtime - data store runtime the task queue belongs to\n\t * @param id - optional name of the task queue\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_taskManager_\");\n\n\t\tthis.opWatcher.on(\n\t\t\t\"volunteer\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\t// We're tracking local ops from this connection. Filter out local ops during \"connecting\"\n\t\t\t\t// state since these were sent on the prior connection and were already cleared from the latestPendingOps.\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07b /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to volunteer and abandon multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"volunteer\", 0x07c /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.addClientToQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"abandon\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x07d /* \"Unexpected op\" */);\n\t\t\t\t\t// Need to check the id, since it's possible to abandon and volunteer multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"abandon\", 0x07e /* \"Unexpected op type\" */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t\t},\n\t\t);\n\n\t\tthis.opWatcher.on(\n\t\t\t\"complete\",\n\t\t\t(taskId: string, clientId: string, local: boolean, messageId: number) => {\n\t\t\t\tif (runtime.connected && local) {\n\t\t\t\t\tconst pendingOp = this.latestPendingOps.get(taskId);\n\t\t\t\t\tassert(pendingOp !== undefined, 0x400 /* Unexpected op */);\n\t\t\t\t\t// Need to check the id, since it's possible to complete multiple times before the acks\n\t\t\t\t\tif (messageId === pendingOp.messageId) {\n\t\t\t\t\t\tassert(pendingOp.type === \"complete\", 0x401 /* Unexpected op type */);\n\t\t\t\t\t\t// Delete the pending, because we no longer have an outstanding op\n\t\t\t\t\t\tthis.latestPendingOps.delete(taskId);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove complete op from this.pendingCompletedTasks\n\t\t\t\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tpendingIds !== undefined && pendingIds.length > 0,\n\t\t\t\t\t\t0x402 /* pendingIds is empty */,\n\t\t\t\t\t);\n\t\t\t\t\tconst removed = pendingIds.shift();\n\t\t\t\t\tassert(removed === messageId, 0x403 /* Removed complete op id does not match */);\n\t\t\t\t}\n\n\t\t\t\t// For clients in queue, we need to remove them from the queue and raise the proper events.\n\t\t\t\tif (!local) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\t\t\t\tthis.emit(\"completed\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\truntime.getQuorum().on(\"removeMember\", (clientId: string) => {\n\t\t\tthis.removeClientFromAllQueues(clientId);\n\t\t});\n\n\t\tthis.queueWatcher.on(\n\t\t\t\"queueChange\",\n\t\t\t(taskId: string, oldLockHolder: string, newLockHolder: string) => {\n\t\t\t\t// If oldLockHolder is placeholderClientId we need to emit the task was lost during the attach process\n\t\t\t\tif (oldLockHolder === placeholderClientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Exit early if we are still catching up on reconnect -- we can't be the leader yet anyway.\n\t\t\t\tif (this.clientId === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (oldLockHolder !== this.clientId && newLockHolder === this.clientId) {\n\t\t\t\t\tthis.emit(\"assigned\", taskId);\n\t\t\t\t} else if (oldLockHolder === this.clientId && newLockHolder !== this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tthis.connectionWatcher.on(\"disconnect\", () => {\n\t\t\tassert(this.clientId !== undefined, 0x1d3 /* \"Missing client id on disconnect\" */);\n\n\t\t\t// We don't modify the taskQueues on disconnect (they still reflect the latest known consensus state).\n\t\t\t// After reconnect these will get cleaned up by observing the clientLeaves.\n\t\t\t// However we do need to recognize that we lost the lock if we had it. Calls to .queued() and\n\t\t\t// .assigned() are also connection-state-aware to be consistent.\n\t\t\tfor (const [taskId, clientQueue] of this.taskQueues.entries()) {\n\t\t\t\tif (this.isAttached() && clientQueue[0] === this.clientId) {\n\t\t\t\t\tthis.emit(\"lost\", taskId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All of our outstanding ops will be for the old clientId even if they get ack'd\n\t\t\tthis.latestPendingOps.clear();\n\t\t});\n\t}\n\n\tprivate submitVolunteerOp(taskId: string): void {\n\t\tconst op: ITaskManagerVolunteerOperation = {\n\t\t\ttype: \"volunteer\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"volunteer\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitAbandonOp(taskId: string): void {\n\t\tconst op: ITaskManagerAbandonOperation = {\n\t\t\ttype: \"abandon\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"abandon\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\tprivate submitCompleteOp(taskId: string): void {\n\t\tconst op: ITaskManagerCompletedOperation = {\n\t\t\ttype: \"complete\",\n\t\t\ttaskId,\n\t\t};\n\t\tconst pendingOp: IPendingOp = {\n\t\t\ttype: \"complete\",\n\t\t\tmessageId: ++this.messageId,\n\t\t};\n\n\t\tif (this.pendingCompletedTasks.has(taskId)) {\n\t\t\tthis.pendingCompletedTasks.get(taskId)?.push(pendingOp.messageId);\n\t\t} else {\n\t\t\tthis.pendingCompletedTasks.set(taskId, [pendingOp.messageId]);\n\t\t}\n\n\t\tthis.submitLocalMessage(op, pendingOp.messageId);\n\t\tthis.latestPendingOps.set(taskId, pendingOp);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.volunteerForTask}\n\t */\n\tpublic async volunteerForTask(taskId: string): Promise<boolean> {\n\t\t// If we have the lock, resolve immediately\n\t\tif (this.assigned(taskId)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true) {\n\t\t\tconst error =\n\t\t\t\tthis.readOnlyInfo.permissions === true\n\t\t\t\t\t? new Error(\"Attempted to volunteer with read-only permissions\")\n\t\t\t\t\t: new Error(\"Attempted to volunteer in read-only state\");\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x472 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.connected) {\n\t\t\tthrow new Error(\"Attempted to volunteer in disconnected state\");\n\t\t}\n\n\t\t// This promise works even if we already have an outstanding volunteer op.\n\t\tconst lockAcquireP = new Promise<boolean>((resolve, reject) => {\n\t\t\tconst checkIfAcquiredLock = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Also check pending ops here because it's possible we are currently in the queue from a previous\n\t\t\t\t// lock attempt, but have an outstanding abandon AND the outstanding volunteer for this lock attempt.\n\t\t\t\t// If we reach the head of the queue based on the previous lock attempt, we don't want to resolve.\n\t\t\t\tif (this.assigned(taskId) && !this.latestPendingOps.has(taskId)) {\n\t\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\t\tresolve(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Abandoned before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst rejectOnDisconnect = (): void => {\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\treject(new Error(\"Disconnected before acquiring task assignment\"));\n\t\t\t};\n\n\t\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.queueWatcher.off(\"queueChange\", checkIfAcquiredLock);\n\t\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\t\tthis.connectionWatcher.off(\"disconnect\", rejectOnDisconnect);\n\t\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\t\t\t\tresolve(false);\n\t\t\t};\n\n\t\t\tthis.queueWatcher.on(\"queueChange\", checkIfAcquiredLock);\n\t\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.on(\"disconnect\", rejectOnDisconnect);\n\t\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\t\t});\n\n\t\tif (!this.queued(taskId)) {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t}\n\t\treturn lockAcquireP;\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribeToTask}\n\t */\n\tpublic subscribeToTask(taskId: string): void {\n\t\tif (this.subscribed(taskId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.readOnlyInfo.readonly === true && this.readOnlyInfo.permissions === true) {\n\t\t\tthrow new Error(\"Attempted to subscribe with read-only permissions\");\n\t\t}\n\n\t\tconst submitVolunteerOp = (): void => {\n\t\t\tthis.submitVolunteerOp(taskId);\n\t\t};\n\n\t\tconst disconnectHandler = (): void => {\n\t\t\t// Wait to be connected again and then re-submit volunteer op\n\t\t\tthis.connectionWatcher.once(\"connect\", submitVolunteerOp);\n\t\t};\n\n\t\tconst checkIfAbandoned = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tconst checkIfCompleted = (eventTaskId: string): void => {\n\t\t\tif (eventTaskId !== taskId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.abandonWatcher.off(\"abandon\", checkIfAbandoned);\n\t\t\tthis.connectionWatcher.off(\"disconnect\", disconnectHandler);\n\t\t\tthis.connectionWatcher.off(\"connect\", submitVolunteerOp);\n\t\t\tthis.completedWatcher.off(\"completed\", checkIfCompleted);\n\n\t\t\tthis.subscribedTasks.delete(taskId);\n\t\t};\n\n\t\tthis.abandonWatcher.on(\"abandon\", checkIfAbandoned);\n\t\tthis.connectionWatcher.on(\"disconnect\", disconnectHandler);\n\t\tthis.completedWatcher.on(\"completed\", checkIfCompleted);\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x473 /* clientId should not be undefined */);\n\t\t\tthis.addClientToQueue(taskId, this.clientId);\n\t\t\t// Because we volunteered with placeholderClientId, we need to wait for when we attach and are assigned\n\t\t\t// a real clientId. At that point we should re-enter the queue with a real volunteer op (assuming we are\n\t\t\t// connected).\n\t\t\tthis.runtime.once(\"attached\", () => {\n\t\t\t\tif (this.queued(taskId)) {\n\t\t\t\t\t// If we are already queued, then we were able to replace the placeholderClientId with our real\n\t\t\t\t\t// clientId and no action is required.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.connected) {\n\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t} else {\n\t\t\t\t\tthis.connectionWatcher.once(\"connect\", () => {\n\t\t\t\t\t\tsubmitVolunteerOp();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (!this.connected) {\n\t\t\t// If we are disconnected (and attached), wait to be connected and submit volunteer op\n\t\t\tdisconnectHandler();\n\t\t} else if (!this.assigned(taskId) && !this.queued(taskId)) {\n\t\t\tsubmitVolunteerOp();\n\t\t}\n\t\tthis.subscribedTasks.add(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.abandon}\n\t */\n\tpublic abandon(taskId: string): void {\n\t\t// Always allow abandon if the client is subscribed to allow clients to unsubscribe while disconnected.\n\t\t// Otherwise, we should check to make sure the client is both connected queued for the task before sending an\n\t\t// abandon op.\n\t\tif (!this.subscribed(taskId) && !this.queued(taskId)) {\n\t\t\t// Nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.isAttached()) {\n\t\t\t// Simulate auto-ack in detached scenario\n\t\t\tassert(this.clientId !== undefined, 0x474 /* clientId is undefined */);\n\t\t\tthis.removeClientFromQueue(taskId, this.clientId);\n\t\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're subscribed but not queued, we don't need to submit an abandon op (probably offline)\n\t\tif (this.queued(taskId)) {\n\t\t\tthis.submitAbandonOp(taskId);\n\t\t}\n\t\tthis.abandonWatcher.emit(\"abandon\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.assigned}\n\t */\n\tpublic assigned(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentAssignee = this.taskQueues.get(taskId)?.[0];\n\t\treturn (\n\t\t\tcurrentAssignee !== undefined &&\n\t\t\tcurrentAssignee === this.clientId &&\n\t\t\t!this.latestPendingOps.has(taskId)\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.queued}\n\t */\n\tpublic queued(taskId: string): boolean {\n\t\tif (this.isAttached() && !this.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(this.clientId !== undefined, 0x07f /* \"clientId undefined\" */);\n\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\t// If we have no queue for the taskId, then no one has signed up for it.\n\t\treturn (\n\t\t\t((clientQueue?.includes(this.clientId) ?? false) &&\n\t\t\t\t!this.latestPendingOps.has(taskId)) ||\n\t\t\tthis.latestPendingOps.get(taskId)?.type === \"volunteer\"\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.subscribed}\n\t */\n\tpublic subscribed(taskId: string): boolean {\n\t\treturn this.subscribedTasks.has(taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.complete}\n\t */\n\tpublic complete(taskId: string): void {\n\t\tif (!this.assigned(taskId)) {\n\t\t\tthrow new Error(\"Attempted to mark task as complete while not being assigned\");\n\t\t}\n\n\t\t// If we are detached we will simulate auto-ack for the complete op. Therefore we only need to send the op if\n\t\t// we are attached. Additionally, we don't need to check if we are connected while detached.\n\t\tif (this.isAttached()) {\n\t\t\tif (!this.connected) {\n\t\t\t\tthrow new Error(\"Attempted to complete task in disconnected state\");\n\t\t\t}\n\t\t\tthis.submitCompleteOp(taskId);\n\t\t}\n\n\t\tthis.taskQueues.delete(taskId);\n\t\tthis.completedWatcher.emit(\"completed\", taskId);\n\t\tthis.emit(\"completed\", taskId);\n\t}\n\n\t/**\n\t * {@inheritDoc ITaskManager.canVolunteer}\n\t */\n\tpublic canVolunteer(): boolean {\n\t\t// A client can volunteer for a task if it's both connected to the delta stream and in write mode.\n\t\t// this.connected reflects that condition, but is unintuitive and may be changed in the future. This API allows\n\t\t// us to make changes to this.connected without affecting our guidance on how to check if a client is eligible\n\t\t// to volunteer for a task.\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Create a summary for the task manager\n\t *\n\t * @returns the summary of the current state of the task manager\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tif (this.runtime.clientId === undefined) {\n\t\t\t// If the runtime has still not been assigned a clientId, we should not summarize with the placeholder\n\t\t\t// clientIds and instead remove them from the queues and require the client to re-volunteer when assigned\n\t\t\t// a new clientId.\n\t\t\tthis.removeClientFromAllQueues(placeholderClientId);\n\t\t} else {\n\t\t\t// If the runtime has been assigned an actual clientId by now, we can replace the placeholder clientIds\n\t\t\t// and maintain the task assignment.\n\t\t\tthis.replacePlaceholderInAllQueues();\n\t\t}\n\n\t\t// Only include tasks if there are clients in the queue.\n\t\tconst filteredMap = new Map<string, string[]>();\n\t\tfor (const [taskId, queue] of this.taskQueues) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tfilteredMap.set(taskId, queue);\n\t\t\t}\n\t\t}\n\t\tconst content = [...filteredMap.entries()];\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(content));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst content = await readAndParse<[string, string[]][]>(storage, snapshotFileName);\n\t\tfor (const [taskId, clientIdQueue] of content) {\n\t\t\tthis.taskQueues.set(taskId, clientIdQueue);\n\t\t}\n\t\tthis.scrubClientsNotInQuorum();\n\t}\n\n\t/***/\n\tprotected initializeLocalCore(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {\n\t\tthis.connectionWatcher.emit(\"disconnect\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}\n\t */\n\tprotected onConnect(): void {\n\t\tthis.connectionWatcher.emit(\"connect\");\n\t}\n\n\t//\n\t/**\n\t * Override resubmit core to avoid resubmission on reconnect. On disconnect we accept our removal from the\n\t * queues, and leave it up to the user to decide whether they want to attempt to re-enter a queue on reconnect.\n\t */\n\tprotected reSubmitCore(): void {}\n\n\t/**\n\t * Process a task manager operation\n\t *\n\t * @param message - the message to prepare\n\t * @param local - whether the message was sent by the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as ITaskManagerOperation;\n\t\t\tconst messageId = localOpMetadata as number;\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"volunteer\": {\n\t\t\t\t\tthis.opWatcher.emit(\"volunteer\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"abandon\": {\n\t\t\t\t\tthis.opWatcher.emit(\"abandon\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"complete\": {\n\t\t\t\t\tthis.opWatcher.emit(\"complete\", op.taskId, message.clientId, local, messageId);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addClientToQueue(taskId: string, clientId: string): void {\n\t\tconst pendingIds = this.pendingCompletedTasks.get(taskId);\n\t\tif (pendingIds !== undefined && pendingIds.length > 0) {\n\t\t\t// Ignore the volunteer op if we know this task is about to be completed\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the clientId exists in the quorum, or it is placeholderClientId (detached scenario)\n\t\tif (\n\t\t\tthis.runtime.getQuorum().getMembers().has(clientId) ||\n\t\t\tthis.clientId === placeholderClientId\n\t\t) {\n\t\t\t// Create the queue if it doesn't exist, and push the client on the back.\n\t\t\tlet clientQueue = this.taskQueues.get(taskId);\n\t\t\tif (clientQueue === undefined) {\n\t\t\t\tclientQueue = [];\n\t\t\t\tthis.taskQueues.set(taskId, clientQueue);\n\t\t\t}\n\n\t\t\tconst oldLockHolder = clientQueue[0];\n\t\t\tclientQueue.push(clientId);\n\t\t\tconst newLockHolder = clientQueue[0];\n\t\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeClientFromQueue(taskId: string, clientId: string): void {\n\t\tconst clientQueue = this.taskQueues.get(taskId);\n\t\tif (clientQueue === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldLockHolder =\n\t\t\tclientId === placeholderClientId ? placeholderClientId : clientQueue[0];\n\t\tconst clientIdIndex = clientQueue.indexOf(clientId);\n\t\tif (clientIdIndex !== -1) {\n\t\t\tclientQueue.splice(clientIdIndex, 1);\n\t\t\t// Clean up the queue if there are no more clients in it.\n\t\t\tif (clientQueue.length === 0) {\n\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t}\n\t\t}\n\t\tconst newLockHolder = clientQueue[0];\n\t\tif (newLockHolder !== oldLockHolder) {\n\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId, oldLockHolder, newLockHolder);\n\t\t}\n\t}\n\n\tprivate removeClientFromAllQueues(clientId: string): void {\n\t\tfor (const taskId of this.taskQueues.keys()) {\n\t\t\tthis.removeClientFromQueue(taskId, clientId);\n\t\t}\n\t}\n\n\t/**\n\t * Will replace all instances of the placeholderClientId with the current clientId. This should only be called when\n\t * transitioning from detached to attached and this.runtime.clientId is defined.\n\t */\n\tprivate replacePlaceholderInAllQueues(): void {\n\t\tassert(\n\t\t\tthis.runtime.clientId !== undefined,\n\t\t\t0x475 /* this.runtime.clientId should be defined */,\n\t\t);\n\t\tfor (const clientQueue of this.taskQueues.values()) {\n\t\t\tconst clientIdIndex = clientQueue.indexOf(placeholderClientId);\n\t\t\tif (clientIdIndex !== -1) {\n\t\t\t\tclientQueue[clientIdIndex] = this.runtime.clientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This seems like it should be unnecessary if we can trust to receive the join/leave messages and\n\t// also have an accurate snapshot.\n\tprivate scrubClientsNotInQuorum(): void {\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tfor (const [taskId, clientQueue] of this.taskQueues) {\n\t\t\tconst filteredClientQueue = clientQueue.filter(\n\t\t\t\t(clientId) => quorum.getMember(clientId) !== undefined,\n\t\t\t);\n\t\t\tif (clientQueue.length !== filteredClientQueue.length) {\n\t\t\t\tif (filteredClientQueue.length === 0) {\n\t\t\t\t\tthis.taskQueues.delete(taskId);\n\t\t\t\t} else {\n\t\t\t\t\tthis.taskQueues.set(taskId, filteredClientQueue);\n\t\t\t\t}\n\t\t\t\tthis.queueWatcher.emit(\"queueChange\", taskId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyStashedOp(content: unknown): void {\n\t\tconst taskOp: ITaskManagerOperation = content as ITaskManagerOperation;\n\t\tswitch (taskOp.type) {\n\t\t\tcase \"abandon\": {\n\t\t\t\tthis.abandon(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"complete\": {\n\t\t\t\tthis.complete(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"volunteer\": {\n\t\t\t\tthis.subscribeToTask(taskOp.taskId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(taskOp);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -20,14 +20,12 @@ export declare class TaskManagerFactory implements IChannelFactory<ITaskManager>
20
20
  }
21
21
  /**
22
22
  * {@inheritDoc ITaskManager}
23
- * @legacy
24
- * @alpha
23
+ * @legacy @beta
25
24
  */
26
25
  export declare const TaskManager: import("@fluidframework/shared-object-base/internal").ISharedObjectKind<ITaskManager> & import("@fluidframework/shared-object-base/internal").SharedObjectKind<ITaskManager>;
27
26
  /**
28
27
  * {@inheritDoc ITaskManager}
29
- * @legacy
30
- * @alpha
28
+ * @legacy @beta
31
29
  */
32
30
  export type TaskManager = ITaskManager;
33
31
  //# sourceMappingURL=taskManagerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"taskManagerFactory.d.ts","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe,CAAC,YAAY,CAAC;IACvE,gBAAuB,IAAI,oDAAoD;IAE/E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAEhD;IAED,IAAW,UAAU,IAAI,OAAO,kBAAkB,CAAC,UAAU,CAE5D;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAMjB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAKzE;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,8KAA6C,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"taskManagerFactory.d.ts","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe,CAAC,YAAY,CAAC;IACvE,gBAAuB,IAAI,oDAAoD;IAE/E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAEhD;IAED,IAAW,UAAU,IAAI,OAAO,kBAAkB,CAAC,UAAU,CAE5D;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAMjB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAKzE;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,8KAA6C,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC"}
@@ -37,8 +37,7 @@ TaskManagerFactory.Attributes = {
37
37
  };
38
38
  /**
39
39
  * {@inheritDoc ITaskManager}
40
- * @legacy
41
- * @alpha
40
+ * @legacy @beta
42
41
  */
43
42
  export const TaskManager = createSharedObjectKind(TaskManagerFactory);
44
43
  //# sourceMappingURL=taskManagerFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taskManagerFactory.js","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAS9B,IAAW,IAAI;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,SAAS,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;;AAlCsB,uBAAI,GAAG,gDAAgD,CAAC;AAExD,6BAAU,GAAuB;IACvD,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AA+BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { TaskManagerClass } from \"./taskManager.js\";\n\n/**\n * The factory that defines the task queue\n */\nexport class TaskManagerFactory implements IChannelFactory<ITaskManager> {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/task-manager\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: TaskManagerFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): typeof TaskManagerFactory.Type {\n\t\treturn TaskManagerFactory.Type;\n\t}\n\n\tpublic get attributes(): typeof TaskManagerFactory.Attributes {\n\t\treturn TaskManagerFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ITaskManager> {\n\t\tconst taskQueue = new TaskManagerClass(id, runtime, attributes);\n\t\tawait taskQueue.load(services);\n\t\treturn taskQueue;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ITaskManager {\n\t\tconst taskQueue = new TaskManagerClass(id, document, this.attributes);\n\t\ttaskQueue.initializeLocal();\n\t\treturn taskQueue;\n\t}\n}\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy\n * @alpha\n */\nexport const TaskManager = createSharedObjectKind(TaskManagerFactory);\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy\n * @alpha\n */\nexport type TaskManager = ITaskManager;\n"]}
1
+ {"version":3,"file":"taskManagerFactory.js","sourceRoot":"","sources":["../src/taskManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAS9B,IAAW,IAAI;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,SAAS,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;;AAlCsB,uBAAI,GAAG,gDAAgD,CAAC;AAExD,6BAAU,GAAuB;IACvD,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AA+BH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ITaskManager } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { TaskManagerClass } from \"./taskManager.js\";\n\n/**\n * The factory that defines the task queue\n */\nexport class TaskManagerFactory implements IChannelFactory<ITaskManager> {\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/task-manager\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: TaskManagerFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): typeof TaskManagerFactory.Type {\n\t\treturn TaskManagerFactory.Type;\n\t}\n\n\tpublic get attributes(): typeof TaskManagerFactory.Attributes {\n\t\treturn TaskManagerFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ITaskManager> {\n\t\tconst taskQueue = new TaskManagerClass(id, runtime, attributes);\n\t\tawait taskQueue.load(services);\n\t\treturn taskQueue;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ITaskManager {\n\t\tconst taskQueue = new TaskManagerClass(id, document, this.attributes);\n\t\ttaskQueue.initializeLocal();\n\t\treturn taskQueue;\n\t}\n}\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy @beta\n */\nexport const TaskManager = createSharedObjectKind(TaskManagerFactory);\n\n/**\n * {@inheritDoc ITaskManager}\n * @legacy @beta\n */\nexport type TaskManager = ITaskManager;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/task-manager",
3
- "version": "2.53.0",
3
+ "version": "2.60.0",
4
4
  "description": "Distributed data structure for queueing exclusive tasks",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,29 +69,29 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "~2.53.0",
73
- "@fluidframework/container-definitions": "~2.53.0",
74
- "@fluidframework/container-runtime-definitions": "~2.53.0",
75
- "@fluidframework/core-interfaces": "~2.53.0",
76
- "@fluidframework/core-utils": "~2.53.0",
77
- "@fluidframework/datastore-definitions": "~2.53.0",
78
- "@fluidframework/driver-definitions": "~2.53.0",
79
- "@fluidframework/driver-utils": "~2.53.0",
80
- "@fluidframework/runtime-definitions": "~2.53.0",
81
- "@fluidframework/shared-object-base": "~2.53.0"
72
+ "@fluid-internal/client-utils": "~2.60.0",
73
+ "@fluidframework/container-definitions": "~2.60.0",
74
+ "@fluidframework/container-runtime-definitions": "~2.60.0",
75
+ "@fluidframework/core-interfaces": "~2.60.0",
76
+ "@fluidframework/core-utils": "~2.60.0",
77
+ "@fluidframework/datastore-definitions": "~2.60.0",
78
+ "@fluidframework/driver-definitions": "~2.60.0",
79
+ "@fluidframework/driver-utils": "~2.60.0",
80
+ "@fluidframework/runtime-definitions": "~2.60.0",
81
+ "@fluidframework/shared-object-base": "~2.60.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.17.1",
85
85
  "@biomejs/biome": "~1.9.3",
86
- "@fluid-internal/mocha-test-setup": "~2.53.0",
87
- "@fluid-private/stochastic-test-utils": "~2.53.0",
88
- "@fluid-private/test-dds-utils": "~2.53.0",
86
+ "@fluid-internal/mocha-test-setup": "~2.60.0",
87
+ "@fluid-private/stochastic-test-utils": "~2.60.0",
88
+ "@fluid-private/test-dds-utils": "~2.60.0",
89
89
  "@fluid-tools/build-cli": "^0.57.0",
90
90
  "@fluidframework/build-common": "^2.0.3",
91
91
  "@fluidframework/build-tools": "^0.57.0",
92
- "@fluidframework/eslint-config-fluid": "^5.7.4",
93
- "@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.52.0",
94
- "@fluidframework/test-runtime-utils": "~2.53.0",
92
+ "@fluidframework/eslint-config-fluid": "^6.0.0",
93
+ "@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.53.0",
94
+ "@fluidframework/test-runtime-utils": "~2.60.0",
95
95
  "@microsoft/api-extractor": "7.52.8",
96
96
  "@types/mocha": "^10.0.10",
97
97
  "@types/node": "^18.19.0",
package/src/interfaces.ts CHANGED
@@ -12,15 +12,13 @@ import type {
12
12
  * Describes the event listener format for {@link ITaskManagerEvents} events.
13
13
  *
14
14
  * @param taskId - The unique identifier of the related task.
15
- * @legacy
16
- * @alpha
15
+ * @legacy @beta
17
16
  */
18
17
  export type TaskEventListener = (taskId: string) => void;
19
18
 
20
19
  /**
21
20
  * Events emitted by {@link ITaskManager}.
22
- * @legacy
23
- * @alpha
21
+ * @legacy @beta
24
22
  */
25
23
  export interface ITaskManagerEvents extends ISharedObjectEvents {
26
24
  /**
@@ -138,8 +136,7 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
138
136
  * when using {@link ITaskManager.subscribeToTask}.
139
137
  *
140
138
  * See {@link ITaskManagerEvents} for more details.
141
- * @legacy
142
- * @alpha
139
+ * @legacy @beta
143
140
  */
144
141
  export interface ITaskManager extends ISharedObject<ITaskManagerEvents> {
145
142
  /**
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/task-manager";
9
- export const pkgVersion = "2.53.0";
9
+ export const pkgVersion = "2.60.0";
@@ -62,8 +62,7 @@ const placeholderClientId = "placeholder";
62
62
  * {@inheritDoc ITaskManager}
63
63
  *
64
64
  * @sealed
65
- * @legacy
66
- * @alpha
65
+ * @legacy @beta
67
66
  */
68
67
  export class TaskManagerClass
69
68
  extends SharedObject<ITaskManagerEvents>
@@ -58,14 +58,12 @@ export class TaskManagerFactory implements IChannelFactory<ITaskManager> {
58
58
 
59
59
  /**
60
60
  * {@inheritDoc ITaskManager}
61
- * @legacy
62
- * @alpha
61
+ * @legacy @beta
63
62
  */
64
63
  export const TaskManager = createSharedObjectKind(TaskManagerFactory);
65
64
 
66
65
  /**
67
66
  * {@inheritDoc ITaskManager}
68
- * @legacy
69
- * @alpha
67
+ * @legacy @beta
70
68
  */
71
69
  export type TaskManager = ITaskManager;