Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Job executions #651

Merged
merged 5 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
FlorianJacta marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def add(nb):

# Configuration of the pipeline and scenario
scenario_cfg = Config.configure_scenario(id="my_scenario",
task_configs=[first_task_cfg,
second_task_cfg])
task_configs=[first_task_cfg,
second_task_cfg])

Config.export("config_07.toml")
FlorianJacta marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
jrobinAV marked this conversation as resolved.
Show resolved Hide resolved
FlorianJacta marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
> You can download the code for
<a href="./../src/step_07.py" download>Step 7</a>
or all the steps <a href="./../src/src.zip" download>here</a>.
> You can download the code
<a href="./../src/step_07.py" download>here</a>.

# Executing jobs

Expand All @@ -13,7 +12,7 @@ Changing the execution mode can be useful for running multiple tasks in parallel

- _development_ mode: synchronous. The default execution mode is _development_.

In this step, we define a new configuration and functions to showcase the two execution modes.
We define a configuration and functions to showcase the two execution modes.

```python
# Normal function used by Taipy
Expand All @@ -26,7 +25,7 @@ def add(nb):
return nb + 10
```

![](config_07.svg){ width=700 style="margin:auto;display:block;border: 4px solid rgb(210,210,210);border-radius:7px" }
![Configuration](config.svg){ width=700 style="margin:auto;display:block;border: 4px solid rgb(210,210,210);border-radius:7px" }

This line of code alters the execution mode. Setting it to _standalone_ makes Taipy Core work asynchronously.
In this configuration, a maximum of two tasks can run simultaneously.
Expand Down Expand Up @@ -92,20 +91,21 @@ output_cfg = Config.configure_data_node("output")

# Configuration of tasks
first_task_cfg = Config.configure_task("double",
double,
input_cfg,
intermediate_cfg)
double,
input_cfg,
intermediate_cfg)

second_task_cfg = Config.configure_task("add",
add,
intermediate_cfg,
output_cfg)
add,
intermediate_cfg,
output_cfg)

# Configuration of the pipeline and scenario
scenario_cfg = Config.configure_scenario(id="my_scenario",
task_configs=[first_task_cfg,
second_task_cfg])
task_configs=[first_task_cfg,
second_task_cfg])

Config.export("config_07.toml")

FlorianJacta marked this conversation as resolved.
Show resolved Hide resolved
if __name__=="__main__":
tp.Core().run()
Expand Down
Loading