@fluidframework/agent-scheduler 2.0.0-internal.1.1.3 → 2.0.0-internal.1.2.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/dist/agent.d.ts +12 -8
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js.map +1 -1
- package/lib/agent.d.ts +12 -8
- package/lib/agent.d.ts.map +1 -1
- package/lib/agent.js.map +1 -1
- package/package.json +11 -11
- package/src/agent.ts +12 -8
package/dist/agent.d.ts
CHANGED
|
@@ -11,14 +11,18 @@ export interface IAgentSchedulerEvents extends IEvent {
|
|
|
11
11
|
/**
|
|
12
12
|
* Event when ownership of task changes
|
|
13
13
|
* @param event - name of the event:
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* "
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* - "picked" - the task has been assigned to this client, in response to pick() being called
|
|
16
|
+
* If client loses this task (due to disconnect), it will attempt to pick it again (on connection)
|
|
17
|
+
* automatically, unless release() is called
|
|
18
|
+
*
|
|
19
|
+
* - "released" - the task was successfully released back to the pool. Client will not attempt to
|
|
20
|
+
* re-acquire the task, unless pick() is called.
|
|
21
|
+
*
|
|
22
|
+
* - "lost" - task is lost due to disconnect or data store / container being attached.
|
|
23
|
+
* Task will be picked up again by some connected client (this client will try as well,
|
|
24
|
+
* unless release() is called)
|
|
25
|
+
*
|
|
22
26
|
* @param listener - callback notified when change happened for particular key
|
|
23
27
|
*/
|
|
24
28
|
(event: "picked" | "released" | "lost", listener: (taskId: string) => void): any;
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACjD
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,OAAE;CAC/E;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,cAAc,CAAC,qBAAqB,CAAC;IAClG;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;;;OAKG;IACH,OAAO,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;OAEG;IACH,WAAW,IAAI,MAAM,EAAE,CAAC;CAC3B"}
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\n\nexport const IAgentScheduler: keyof IProvideAgentScheduler = \"IAgentScheduler\";\n\nexport interface IProvideAgentScheduler {\n readonly IAgentScheduler: IAgentScheduler;\n}\n\nexport interface IAgentSchedulerEvents extends IEvent {\n /**\n * Event when ownership of task changes\n * @param event - name of the event:\n * \"picked\" - the task has been assigned to this client, in response to pick() being called\n *
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\n\nexport const IAgentScheduler: keyof IProvideAgentScheduler = \"IAgentScheduler\";\n\nexport interface IProvideAgentScheduler {\n readonly IAgentScheduler: IAgentScheduler;\n}\n\nexport interface IAgentSchedulerEvents extends IEvent {\n /**\n * Event when ownership of task changes\n * @param event - name of the event:\n *\n * - \"picked\" - the task has been assigned to this client, in response to pick() being called\n * If client loses this task (due to disconnect), it will attempt to pick it again (on connection)\n * automatically, unless release() is called\n *\n * - \"released\" - the task was successfully released back to the pool. Client will not attempt to\n * re-acquire the task, unless pick() is called.\n *\n * - \"lost\" - task is lost due to disconnect or data store / container being attached.\n * Task will be picked up again by some connected client (this client will try as well,\n * unless release() is called)\n *\n * @param listener - callback notified when change happened for particular key\n */\n (event: \"picked\" | \"released\" | \"lost\", listener: (taskId: string) => void);\n}\n\n/**\n * Agent scheduler distributes a set of tasks/variables across connected clients.\n */\nexport interface IAgentScheduler extends IProvideAgentScheduler, IEventProvider<IAgentSchedulerEvents> {\n /**\n * Registers a set of new tasks to distribute amongst connected clients. Only use this if a client wants\n * a new agent to run but does not have the capability to run the agent inside the host.\n * Client can call pick() later if the capability changes.\n *\n * This method should only be called once per task. Duplicate calls will be rejected.\n */\n register(...taskUrls: string[]): Promise<void>;\n\n /**\n * Attempts to pick a set of tasks. A client will only run the task if it's chosen based on consensus.\n * Resolves when the tasks are assigned to one of the connected clients.\n *\n * This method should only be called once per task. Duplicate calls will be rejected.\n *\n * @param worker - callback to run when task is picked up.\n */\n pick(taskId: string, worker: () => Promise<void>): Promise<void>;\n\n /**\n * Releases a set of tasks for other clients to grab. Resolves when the tasks are released.\n *\n * Only previously picked tasks are allowed. Releasing non picked tasks will get a rejection.\n * App can call pickedTasks() to get the picked list first.\n */\n release(...taskUrls: string[]): Promise<void>;\n\n /**\n * Returns a list of all tasks running on this client\n */\n pickedTasks(): string[];\n}\n"]}
|
package/lib/agent.d.ts
CHANGED
|
@@ -11,14 +11,18 @@ export interface IAgentSchedulerEvents extends IEvent {
|
|
|
11
11
|
/**
|
|
12
12
|
* Event when ownership of task changes
|
|
13
13
|
* @param event - name of the event:
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* "
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* - "picked" - the task has been assigned to this client, in response to pick() being called
|
|
16
|
+
* If client loses this task (due to disconnect), it will attempt to pick it again (on connection)
|
|
17
|
+
* automatically, unless release() is called
|
|
18
|
+
*
|
|
19
|
+
* - "released" - the task was successfully released back to the pool. Client will not attempt to
|
|
20
|
+
* re-acquire the task, unless pick() is called.
|
|
21
|
+
*
|
|
22
|
+
* - "lost" - task is lost due to disconnect or data store / container being attached.
|
|
23
|
+
* Task will be picked up again by some connected client (this client will try as well,
|
|
24
|
+
* unless release() is called)
|
|
25
|
+
*
|
|
22
26
|
* @param listener - callback notified when change happened for particular key
|
|
23
27
|
*/
|
|
24
28
|
(event: "picked" | "released" | "lost", listener: (taskId: string) => void): any;
|
package/lib/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACjD
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE5E,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,OAAE;CAC/E;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,cAAc,CAAC,qBAAqB,CAAC;IAClG;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;;;OAKG;IACH,OAAO,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;OAEG;IACH,WAAW,IAAI,MAAM,EAAE,CAAC;CAC3B"}
|
package/lib/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\n\nexport const IAgentScheduler: keyof IProvideAgentScheduler = \"IAgentScheduler\";\n\nexport interface IProvideAgentScheduler {\n readonly IAgentScheduler: IAgentScheduler;\n}\n\nexport interface IAgentSchedulerEvents extends IEvent {\n /**\n * Event when ownership of task changes\n * @param event - name of the event:\n * \"picked\" - the task has been assigned to this client, in response to pick() being called\n *
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\n\nexport const IAgentScheduler: keyof IProvideAgentScheduler = \"IAgentScheduler\";\n\nexport interface IProvideAgentScheduler {\n readonly IAgentScheduler: IAgentScheduler;\n}\n\nexport interface IAgentSchedulerEvents extends IEvent {\n /**\n * Event when ownership of task changes\n * @param event - name of the event:\n *\n * - \"picked\" - the task has been assigned to this client, in response to pick() being called\n * If client loses this task (due to disconnect), it will attempt to pick it again (on connection)\n * automatically, unless release() is called\n *\n * - \"released\" - the task was successfully released back to the pool. Client will not attempt to\n * re-acquire the task, unless pick() is called.\n *\n * - \"lost\" - task is lost due to disconnect or data store / container being attached.\n * Task will be picked up again by some connected client (this client will try as well,\n * unless release() is called)\n *\n * @param listener - callback notified when change happened for particular key\n */\n (event: \"picked\" | \"released\" | \"lost\", listener: (taskId: string) => void);\n}\n\n/**\n * Agent scheduler distributes a set of tasks/variables across connected clients.\n */\nexport interface IAgentScheduler extends IProvideAgentScheduler, IEventProvider<IAgentSchedulerEvents> {\n /**\n * Registers a set of new tasks to distribute amongst connected clients. Only use this if a client wants\n * a new agent to run but does not have the capability to run the agent inside the host.\n * Client can call pick() later if the capability changes.\n *\n * This method should only be called once per task. Duplicate calls will be rejected.\n */\n register(...taskUrls: string[]): Promise<void>;\n\n /**\n * Attempts to pick a set of tasks. A client will only run the task if it's chosen based on consensus.\n * Resolves when the tasks are assigned to one of the connected clients.\n *\n * This method should only be called once per task. Duplicate calls will be rejected.\n *\n * @param worker - callback to run when task is picked up.\n */\n pick(taskId: string, worker: () => Promise<void>): Promise<void>;\n\n /**\n * Releases a set of tasks for other clients to grab. Resolves when the tasks are released.\n *\n * Only previously picked tasks are allowed. Releasing non picked tasks will get a rejection.\n * App can call pickedTasks() to get the picked list first.\n */\n release(...taskUrls: string[]): Promise<void>;\n\n /**\n * Returns a list of all tasks running on this client\n */\n pickedTasks(): string[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/agent-scheduler",
|
|
3
|
-
"version": "2.0.0-internal.1.
|
|
3
|
+
"version": "2.0.0-internal.1.2.0",
|
|
4
4
|
"description": "Built in runtime object for distributing agents across instances of a container",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
55
55
|
"@fluidframework/common-utils": "^1.0.0",
|
|
56
|
-
"@fluidframework/container-definitions": "^2.0.0-internal.1.
|
|
57
|
-
"@fluidframework/core-interfaces": "^2.0.0-internal.1.
|
|
58
|
-
"@fluidframework/datastore": "^2.0.0-internal.1.
|
|
59
|
-
"@fluidframework/datastore-definitions": "^2.0.0-internal.1.
|
|
60
|
-
"@fluidframework/map": "^2.0.0-internal.1.
|
|
61
|
-
"@fluidframework/register-collection": "^2.0.0-internal.1.
|
|
62
|
-
"@fluidframework/runtime-definitions": "^2.0.0-internal.1.
|
|
63
|
-
"@fluidframework/runtime-utils": "^2.0.0-internal.1.
|
|
56
|
+
"@fluidframework/container-definitions": "^2.0.0-internal.1.2.0",
|
|
57
|
+
"@fluidframework/core-interfaces": "^2.0.0-internal.1.2.0",
|
|
58
|
+
"@fluidframework/datastore": "^2.0.0-internal.1.2.0",
|
|
59
|
+
"@fluidframework/datastore-definitions": "^2.0.0-internal.1.2.0",
|
|
60
|
+
"@fluidframework/map": "^2.0.0-internal.1.2.0",
|
|
61
|
+
"@fluidframework/register-collection": "^2.0.0-internal.1.2.0",
|
|
62
|
+
"@fluidframework/runtime-definitions": "^2.0.0-internal.1.2.0",
|
|
63
|
+
"@fluidframework/runtime-utils": "^2.0.0-internal.1.2.0",
|
|
64
64
|
"uuid": "^8.3.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@fluidframework/agent-scheduler-previous": "npm:@fluidframework/agent-scheduler@^1.1.0",
|
|
68
|
-
"@fluidframework/build-common": "^0.
|
|
69
|
-
"@fluidframework/eslint-config-fluid": "^0.
|
|
68
|
+
"@fluidframework/build-common": "^1.0.0",
|
|
69
|
+
"@fluidframework/eslint-config-fluid": "^1.0.0",
|
|
70
70
|
"@rushstack/eslint-config": "^2.5.1",
|
|
71
71
|
"@types/mocha": "^9.1.1",
|
|
72
72
|
"@types/node": "^14.18.0",
|
package/src/agent.ts
CHANGED
|
@@ -15,14 +15,18 @@ export interface IAgentSchedulerEvents extends IEvent {
|
|
|
15
15
|
/**
|
|
16
16
|
* Event when ownership of task changes
|
|
17
17
|
* @param event - name of the event:
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* "
|
|
24
|
-
*
|
|
25
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* - "picked" - the task has been assigned to this client, in response to pick() being called
|
|
20
|
+
* If client loses this task (due to disconnect), it will attempt to pick it again (on connection)
|
|
21
|
+
* automatically, unless release() is called
|
|
22
|
+
*
|
|
23
|
+
* - "released" - the task was successfully released back to the pool. Client will not attempt to
|
|
24
|
+
* re-acquire the task, unless pick() is called.
|
|
25
|
+
*
|
|
26
|
+
* - "lost" - task is lost due to disconnect or data store / container being attached.
|
|
27
|
+
* Task will be picked up again by some connected client (this client will try as well,
|
|
28
|
+
* unless release() is called)
|
|
29
|
+
*
|
|
26
30
|
* @param listener - callback notified when change happened for particular key
|
|
27
31
|
*/
|
|
28
32
|
(event: "picked" | "released" | "lost", listener: (taskId: string) => void);
|