You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/SchedulerDemo/README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
# Using scheduler API in Hyperflow workflows
2
2
3
-
A scheduler in general makes two decisions: (1) *when* (at which point in time) and (2) *where* (on which node) to run a *workflow task*. To this end, two API functions are provided:
3
+
A scheduler in general makes two decisions: (1) *when* (at which point in time) and (2) *where* (on which node) to run a *workflow task*. To this end, three API functions are provided:
4
4
5
5
```
6
6
let node = await scheduler.getTaskExecutionPermission(context.appId, context.procId);
7
7
```
8
8
This function will wait until the scheduler permits to execute the task (*when*) and return the node name on which the task should be executed (*where*).
9
9
10
+
```
11
+
scheduler.addTaskItem(taskItem, taskFunction2Cb)
12
+
```
13
+
This is an asynchronous alternative of `getTaskExecutionPermission`, also enabling the scheduler to [agglomerate tasks](https://github.com/hyperflow-wms/hyperflow/wiki/Task-agglomeration). See documentation in the code for details.
0 commit comments