Skip to content

Commit 20e02b9

Browse files
committed
Updated docs a bit.
1 parent f676666 commit 20e02b9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

docs/guide/cli.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ taskiq worker mybroker:broker_var my_project.module1 my_project.module2
2020

2121
### Sync function
2222

23-
Taskiq can run sync function. But since it's asynchronous system, it runs it in separate thread or process.
24-
By default process pool is used. But if you are going to use taskiq for heavy computations, such as neural network
25-
model training or other calculations, you might want to use processpool instead.
23+
Taskiq can run synchronous functions. However, since it operates asynchronously, it executes them in a separate thread or process. By default, **ThreadPoolExecutor** is used. But if you're planning to use Taskiq for heavy computations, such as neural network model training or other CPU-intensive tasks, you may want to use **ProcessPoolExecutor** instead.
2624

27-
More precisely about the difference you can read in [python docs about executors](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor).
25+
For more details on the differences between these two options, refer to the [Python docs on executors](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor).
2826

2927
As a rule of thumb:
30-
* If you're using sync functions for IO then use `threadpool`;
31-
* If you're using sync functions for CPU bound workloads then use processpool.
28+
* If you're using sync functions for IO then use `ThreadPoolExecutor`;
29+
* If you're using sync functions for CPU bound workloads then use `ProcessPoolExecutor`.
3230

33-
By default taskiq uses threadpool. If you want to change this behavior, use these parameters:
31+
By default taskiq uses **threadpool**. Here are some worker CLI options that can adjust its behavior:
3432

35-
* `--use-process-pool` to switch to processpools;
33+
* `--use-process-pool` to switch to `ProcessPoolExecutor`;
3634
* `--max-process-pool-processes` to manually specify worker processes;
37-
* `--max-threadpool-threads` to configure maximum threads for threadpool if it's being used;
35+
* `--max-threadpool-threads` to configure maximum threads for `ThreadPoolExecutor` if it's the one being used;
3836

3937
### Auto importing
4038

0 commit comments

Comments
 (0)