-
Notifications
You must be signed in to change notification settings - Fork 105
/
concord.yml
45 lines (39 loc) · 1.12 KB
/
concord.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
flows:
default:
# "forks" the current process as multiple subprocesses
- task: concord
in:
action: fork
tags: forkJoinChild
# disable the `onCancel` handler, because it's going to handle
# the parent's cancellation only
disableOnCancel: true
forks:
# spawn multiple jobs with different parameters
- entryPoint: aJob
arguments:
color: "red"
- entryPoint: aJob
arguments:
color: "green"
- entryPoint: aJob
arguments:
color: "blue"
# out variable "myJobs" will contain a list of process IDs
out:
myJobs: ${jobs}
- log: "Done! Status of the jobs: ${concord.waitForCompletion(myJobs)}"
aJob:
- log: "FORK (${color}) starting..."
- ${sleep.ms(15000)}
- log: "...done!"
onCancel:
# find and cancel the tagged subprocesses
- task: concord
in:
action: kill
# because onCancel is a separate subprocess, we need to use
# 'parentInstanceId'
instanceId: "${concord.listSubprocesses(parentInstanceId, 'forkJoinChild')}"
sync: true
- log: "Jobs are cancelled!"