A
A
Alexey Poloz2018-02-03 03:39:21
Python
Alexey Poloz, 2018-02-03 03:39:21

How to implement function execution queues in multithreading?

It is necessary to make the library execute tasks from different modules in turn
The library does not support multithreading
Please give the simplest example of how this can be implemented
Example
There is a main.py file in which two modules are attached and run in multithreading
Both modules connect one and the same same library Telegram
But this library does not support multithreading
How to implement queues? How is this file with the library attached separately? etc

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-02-03
@sim3x

It is necessary to take the "threading" outside the script
If the script processes requests - nginx-uWSGI-flask (django)
If batch processing - bash-parallel-main.py -parameter_from 0 -parameter_to 10
In isolated cases when real queues are required - celery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question