@fluidframework/task-manager 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.265721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/api-report/task-manager.api.md +9 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +3 -3
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/taskManager.d.ts +4 -19
- package/dist/taskManager.d.ts.map +1 -1
- package/dist/taskManager.js +4 -23
- package/dist/taskManager.js.map +1 -1
- package/dist/taskManagerFactory.d.ts +12 -2
- package/dist/taskManagerFactory.d.ts.map +1 -1
- package/dist/taskManagerFactory.js +9 -3
- package/dist/taskManagerFactory.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +3 -3
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/taskManager.d.ts +4 -19
- package/lib/taskManager.d.ts.map +1 -1
- package/lib/taskManager.js +3 -22
- package/lib/taskManager.js.map +1 -1
- package/lib/taskManagerFactory.d.ts +12 -2
- package/lib/taskManagerFactory.d.ts.map +1 -1
- package/lib/taskManagerFactory.js +9 -3
- package/lib/taskManagerFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +24 -20
- package/src/index.ts +1 -1
- package/src/interfaces.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/taskManager.ts +11 -30
- package/src/taskManagerFactory.ts +19 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/task-manager",
|
|
3
|
-
"version": "2.0.0-dev-rc.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.265721",
|
|
4
4
|
"description": "Distributed data structure for queueing exclusive tasks",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,30 +67,30 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.0.0-dev-rc.
|
|
71
|
-
"@fluidframework/container-definitions": "2.0.0-dev-rc.
|
|
72
|
-
"@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.
|
|
73
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.
|
|
74
|
-
"@fluidframework/core-utils": "2.0.0-dev-rc.
|
|
75
|
-
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.
|
|
76
|
-
"@fluidframework/driver-utils": "2.0.0-dev-rc.
|
|
70
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
71
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.265721",
|
|
72
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.5.0.0.265721",
|
|
73
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.265721",
|
|
74
|
+
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
75
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.265721",
|
|
76
|
+
"@fluidframework/driver-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
77
77
|
"@fluidframework/protocol-definitions": "^3.2.0",
|
|
78
|
-
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.
|
|
79
|
-
"@fluidframework/shared-object-base": "2.0.0-dev-rc.
|
|
78
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.265721",
|
|
79
|
+
"@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.265721"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
83
83
|
"@biomejs/biome": "^1.6.2",
|
|
84
|
-
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.
|
|
85
|
-
"@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.
|
|
86
|
-
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.
|
|
87
|
-
"@fluid-tools/build-cli": "0.
|
|
84
|
+
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.265721",
|
|
85
|
+
"@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
86
|
+
"@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
87
|
+
"@fluid-tools/build-cli": "^0.39.0-264124",
|
|
88
88
|
"@fluidframework/build-common": "^2.0.3",
|
|
89
|
-
"@fluidframework/build-tools": "0.
|
|
89
|
+
"@fluidframework/build-tools": "^0.39.0-264124",
|
|
90
90
|
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
91
|
-
"@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.0.0-rc.
|
|
92
|
-
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.
|
|
93
|
-
"@microsoft/api-extractor": "^7.
|
|
91
|
+
"@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.0.0-rc.4.0.0",
|
|
92
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.265721",
|
|
93
|
+
"@microsoft/api-extractor": "^7.43.1",
|
|
94
94
|
"@types/mocha": "^9.1.1",
|
|
95
95
|
"@types/node": "^18.19.0",
|
|
96
96
|
"c8": "^8.0.1",
|
|
@@ -105,10 +105,14 @@
|
|
|
105
105
|
"prettier": "~3.0.3",
|
|
106
106
|
"replace-in-file": "^6.3.5",
|
|
107
107
|
"rimraf": "^4.4.0",
|
|
108
|
-
"typescript": "~5.
|
|
108
|
+
"typescript": "~5.3.3"
|
|
109
109
|
},
|
|
110
110
|
"typeValidation": {
|
|
111
|
-
"broken": {
|
|
111
|
+
"broken": {
|
|
112
|
+
"RemovedClassDeclaration_TaskManager": {
|
|
113
|
+
"backCompat": false
|
|
114
|
+
}
|
|
115
|
+
}
|
|
112
116
|
},
|
|
113
117
|
"scripts": {
|
|
114
118
|
"api": "fluid-build . --task api",
|
package/src/index.ts
CHANGED
package/src/interfaces.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
|
|
6
|
+
import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base/internal";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Describes the event listener format for {@link ITaskManagerEvents} events.
|
|
@@ -14,7 +14,7 @@ import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-objec
|
|
|
14
14
|
export type TaskEventListener = (taskId: string) => void;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Events emitted by {@link
|
|
17
|
+
* Events emitted by {@link ITaskManager}.
|
|
18
18
|
* @alpha
|
|
19
19
|
*/
|
|
20
20
|
export interface ITaskManagerEvents extends ISharedObjectEvents {
|
|
@@ -49,7 +49,7 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
|
|
|
49
49
|
*
|
|
50
50
|
* @example Creation
|
|
51
51
|
*
|
|
52
|
-
* To create a {@link
|
|
52
|
+
* To create a {@link ITaskManager}, call the static create method:
|
|
53
53
|
*
|
|
54
54
|
* ```typescript
|
|
55
55
|
* const taskManager = TaskManager.create(this.runtime, id);
|
package/src/packageVersion.ts
CHANGED
package/src/taskManager.ts
CHANGED
|
@@ -4,22 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import { ReadOnlyInfo } from "@fluidframework/container-definitions";
|
|
7
|
+
import { ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
|
|
8
8
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
9
9
|
import {
|
|
10
10
|
IChannelAttributes,
|
|
11
|
-
IChannelFactory,
|
|
12
|
-
IChannelStorageService,
|
|
13
11
|
IFluidDataStoreRuntime,
|
|
14
|
-
|
|
12
|
+
IChannelStorageService,
|
|
13
|
+
} from "@fluidframework/datastore-definitions/internal";
|
|
15
14
|
import { readAndParse } from "@fluidframework/driver-utils/internal";
|
|
16
15
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
17
|
-
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
18
|
-
import {
|
|
19
|
-
|
|
16
|
+
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
|
|
17
|
+
import {
|
|
18
|
+
IFluidSerializer,
|
|
19
|
+
SharedObject,
|
|
20
|
+
createSingleBlobSummary,
|
|
21
|
+
} from "@fluidframework/shared-object-base/internal";
|
|
20
22
|
|
|
21
23
|
import { ITaskManager, ITaskManagerEvents } from "./interfaces.js";
|
|
22
|
-
import { TaskManagerFactory } from "./taskManagerFactory.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Description of a task manager operation
|
|
@@ -62,27 +63,7 @@ const placeholderClientId = "placeholder";
|
|
|
62
63
|
* @sealed
|
|
63
64
|
* @alpha
|
|
64
65
|
*/
|
|
65
|
-
export class
|
|
66
|
-
/**
|
|
67
|
-
* Create a new TaskManager
|
|
68
|
-
*
|
|
69
|
-
* @param runtime - data store runtime the new task queue belongs to
|
|
70
|
-
* @param id - optional name of the task queue
|
|
71
|
-
* @returns newly create task queue (but not attached yet)
|
|
72
|
-
*/
|
|
73
|
-
public static create(runtime: IFluidDataStoreRuntime, id?: string) {
|
|
74
|
-
return runtime.createChannel(id, TaskManagerFactory.Type) as TaskManager;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Get a factory for TaskManager to register with the data store.
|
|
79
|
-
*
|
|
80
|
-
* @returns a factory that creates and load TaskManager
|
|
81
|
-
*/
|
|
82
|
-
public static getFactory(): IChannelFactory {
|
|
83
|
-
return new TaskManagerFactory();
|
|
84
|
-
}
|
|
85
|
-
|
|
66
|
+
export class TaskManagerClass extends SharedObject<ITaskManagerEvents> implements ITaskManager {
|
|
86
67
|
/**
|
|
87
68
|
* Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the
|
|
88
69
|
* queue, even if we know we've submitted an op that should eventually modify the queue.
|
|
@@ -127,7 +108,7 @@ export class TaskManager extends SharedObject<ITaskManagerEvents> implements ITa
|
|
|
127
108
|
* Returns a ReadOnlyInfo object to determine current read/write permissions.
|
|
128
109
|
*/
|
|
129
110
|
private get readOnlyInfo(): ReadOnlyInfo {
|
|
130
|
-
return this.
|
|
111
|
+
return this.deltaManager.readOnlyInfo;
|
|
131
112
|
}
|
|
132
113
|
|
|
133
114
|
/**
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
import {
|
|
7
7
|
IChannelAttributes,
|
|
8
8
|
IChannelFactory,
|
|
9
|
-
IChannelServices,
|
|
10
9
|
IFluidDataStoreRuntime,
|
|
11
|
-
|
|
10
|
+
IChannelServices,
|
|
11
|
+
} from "@fluidframework/datastore-definitions/internal";
|
|
12
|
+
import { createSharedObjectKind } from "@fluidframework/shared-object-base/internal";
|
|
12
13
|
|
|
13
14
|
import { ITaskManager } from "./interfaces.js";
|
|
14
15
|
import { pkgVersion } from "./packageVersion.js";
|
|
15
|
-
import {
|
|
16
|
+
import { TaskManagerClass } from "./taskManager.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* The factory that defines the task queue
|
|
19
20
|
*/
|
|
20
|
-
export class TaskManagerFactory implements IChannelFactory {
|
|
21
|
+
export class TaskManagerFactory implements IChannelFactory<ITaskManager> {
|
|
21
22
|
public static readonly Type = "https://graph.microsoft.com/types/task-manager";
|
|
22
23
|
|
|
23
24
|
public static readonly Attributes: IChannelAttributes = {
|
|
@@ -43,14 +44,26 @@ export class TaskManagerFactory implements IChannelFactory {
|
|
|
43
44
|
services: IChannelServices,
|
|
44
45
|
attributes: IChannelAttributes,
|
|
45
46
|
): Promise<ITaskManager> {
|
|
46
|
-
const taskQueue = new
|
|
47
|
+
const taskQueue = new TaskManagerClass(id, runtime, attributes);
|
|
47
48
|
await taskQueue.load(services);
|
|
48
49
|
return taskQueue;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
public create(document: IFluidDataStoreRuntime, id: string): ITaskManager {
|
|
52
|
-
const taskQueue = new
|
|
53
|
+
const taskQueue = new TaskManagerClass(id, document, this.attributes);
|
|
53
54
|
taskQueue.initializeLocal();
|
|
54
55
|
return taskQueue;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* {@inheritDoc ITaskManager}
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export const TaskManager = createSharedObjectKind(TaskManagerFactory);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* {@inheritDoc ITaskManager}
|
|
67
|
+
* @alpha
|
|
68
|
+
*/
|
|
69
|
+
export type TaskManager = ITaskManager;
|