You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
26
+
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).
28
+
29
+
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.
32
+
33
+
By default taskiq uses threadpool. If you want to change this behavior, use these parameters:
34
+
35
+
*`--use-process-pool` to switch to processpools;
36
+
*`--max-process-pool-processes` to manually specify worker processes;
37
+
*`--max-threadpool-threads` to configure maximum threads for threadpool if it's being used;
38
+
21
39
### Auto importing
22
40
23
41
Enumerating all modules with tasks is not an option sometimes.
0 commit comments