Skip to content

Commit

Permalink
Update Job executions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianJacta committed Oct 11, 2023
1 parent 0be204e commit c89e620
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 +26,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" }
![](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 +92,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")

if __name__=="__main__":
tp.Core().run()
Expand Down

0 comments on commit c89e620

Please sign in to comment.