@fluidframework/task-manager 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.263932

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/task-manager.api.md +6 -32
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/interfaces.d.ts +2 -2
  8. package/dist/interfaces.js.map +1 -1
  9. package/dist/packageVersion.d.ts +1 -1
  10. package/dist/packageVersion.js +1 -1
  11. package/dist/packageVersion.js.map +1 -1
  12. package/dist/taskManager.d.ts +2 -16
  13. package/dist/taskManager.d.ts.map +1 -1
  14. package/dist/taskManager.js +4 -23
  15. package/dist/taskManager.js.map +1 -1
  16. package/dist/taskManagerFactory.d.ts +11 -1
  17. package/dist/taskManagerFactory.d.ts.map +1 -1
  18. package/dist/taskManagerFactory.js +9 -3
  19. package/dist/taskManagerFactory.js.map +1 -1
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.d.ts.map +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/index.js.map +1 -1
  24. package/lib/interfaces.d.ts +2 -2
  25. package/lib/interfaces.js.map +1 -1
  26. package/lib/packageVersion.d.ts +1 -1
  27. package/lib/packageVersion.js +1 -1
  28. package/lib/packageVersion.js.map +1 -1
  29. package/lib/taskManager.d.ts +2 -16
  30. package/lib/taskManager.d.ts.map +1 -1
  31. package/lib/taskManager.js +2 -21
  32. package/lib/taskManager.js.map +1 -1
  33. package/lib/taskManagerFactory.d.ts +11 -1
  34. package/lib/taskManagerFactory.d.ts.map +1 -1
  35. package/lib/taskManagerFactory.js +9 -3
  36. package/lib/taskManagerFactory.js.map +1 -1
  37. package/lib/tsdoc-metadata.json +1 -1
  38. package/package.json +30 -18
  39. package/src/index.ts +1 -1
  40. package/src/interfaces.ts +2 -2
  41. package/src/packageVersion.ts +1 -1
  42. package/src/taskManager.ts +3 -25
  43. package/src/taskManagerFactory.ts +17 -4
@@ -4,11 +4,10 @@
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
11
  IChannelStorageService,
13
12
  IFluidDataStoreRuntime,
14
13
  } from "@fluidframework/datastore-definitions";
@@ -19,7 +18,6 @@ import { IFluidSerializer } from "@fluidframework/shared-object-base";
19
18
  import { SharedObject, createSingleBlobSummary } from "@fluidframework/shared-object-base/internal";
20
19
 
21
20
  import { ITaskManager, ITaskManagerEvents } from "./interfaces.js";
22
- import { TaskManagerFactory } from "./taskManagerFactory.js";
23
21
 
24
22
  /**
25
23
  * Description of a task manager operation
@@ -62,27 +60,7 @@ const placeholderClientId = "placeholder";
62
60
  * @sealed
63
61
  * @alpha
64
62
  */
65
- export class TaskManager extends SharedObject<ITaskManagerEvents> implements ITaskManager {
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
-
63
+ export class TaskManagerClass extends SharedObject<ITaskManagerEvents> implements ITaskManager {
86
64
  /**
87
65
  * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the
88
66
  * queue, even if we know we've submitted an op that should eventually modify the queue.
@@ -127,7 +105,7 @@ export class TaskManager extends SharedObject<ITaskManagerEvents> implements ITa
127
105
  * Returns a ReadOnlyInfo object to determine current read/write permissions.
128
106
  */
129
107
  private get readOnlyInfo(): ReadOnlyInfo {
130
- return this.runtime.deltaManager.readOnlyInfo;
108
+ return this.deltaManager.readOnlyInfo;
131
109
  }
132
110
 
133
111
  /**
@@ -9,15 +9,16 @@ import {
9
9
  IChannelServices,
10
10
  IFluidDataStoreRuntime,
11
11
  } from "@fluidframework/datastore-definitions";
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 { TaskManager } from "./taskManager.js";
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 TaskManager(id, runtime, attributes);
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 TaskManager(id, document, this.attributes);
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;