-
Notifications
You must be signed in to change notification settings - Fork 304
Expand file tree
/
Copy pathbackground_action.yml
More file actions
42 lines (42 loc) · 840 Bytes
/
background_action.yml
File metadata and controls
42 lines (42 loc) · 840 Bytes
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
metadata:
title: Return a value
example start: 1
example end: 6
documentation: "https://docassemble.org/docs/background.html#background_action"
---
mandatory: True
code: |
the_task
if the_task.ready():
final_screen
else:
waiting_screen
---
code: |
the_task = background_action('bg_task', additional=value_to_add)
---
question: |
How much shall I add to 553?
fields:
- Number: value_to_add
datatype: integer
---
event: bg_task
code: |
# This is where time-consuming code
# would go.
background_response(553 + action_argument('additional'))
---
event: waiting_screen
question: |
Hang tight.
Still waiting for an answer.
subquestion: |
This screen will reload every
ten seconds until the answer
is available.
reload: True
---
event: final_screen
question: |
The answer is ${ the_task.get() }.