Skip to content

Job execution config

The JobConfig allows the developer to configure the Taipy behavior for job executions. Two main modes are available in Taipy: the standalone and the development mode (available for debugging).

Standalone mode

With the standalone mode, Taipy executes the Job in its own execution context. You can configure the standalone mode with the following config:

1
2
3
from taipy import Config

Config.configure_job_executions(mode="standalone")
1
2
3
from taipy import Config

Config.load("config.toml")
config.toml
1
2
[JOB]
mode = "standalone"

Note

Note that if no mode is configured, the standalone mode is used.

By default, Taipy executes each Job one-by-one, in a synchronous manner. You can ensure this behavior with:

1
2
3
from taipy import Config

Config.configure_job_executions(mode="standalone", nb_of_workers=1)
1
2
3
from taipy import Config

Config.load("config.toml")
config.toml
1
2
3
[JOB]
mode = "standalone"
nb_of_workers = "1:int"

Note

If no value is provided in the nb_of_workers setting in the configuration, Taipy will set this value to 1.

To execute multiple Job simultaneously, you can set the nb_of_workers to an integer value greater than 1. That starts each Job in a dedicated process with nb_of_workers as the limit of concurrent processes that can run simultaneously.

For example, the following configuration will allow Taipy to run up to eight Job simultaneously:

1
2
3
from taipy import Config

Config.configure_job_executions(mode="standalone", nb_of_workers=8)
1
2
3
from taipy import Config

Config.load("config.toml")
config.toml
1
2
3
[JOB]
mode = "standalone"
nb_of_workers = "8:int"

Development mode

With the development mode, the jobs are executed one by one in a synchronous way. This is particularly useful to test a job execution and or investigate an issue. The development mode can be activated with the following config :

1
2
3
from taipy import Config

Config.configure_job_executions(mode="development")
1
2
3
from taipy import Config

Config.load("config.toml")
config.toml
1
2
[JOB]
mode = "development"

The next section introduces the configuration checker.