Skip to content

Commit b60e8cf

Browse files
authored
Update README.md
1 parent 39c63d2 commit b60e8cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/SchedulerDemo/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Using scheduler API in Hyperflow workflows
22

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:
44

55
```
66
let node = await scheduler.getTaskExecutionPermission(context.appId, context.procId);
77
```
88
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*).
99

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.
14+
1015
```
1116
scheduler.notifyTaskCompletion(context.appId, context.procId);
1217
```

0 commit comments

Comments
 (0)