Closed hu6360567 closed 6 years ago
Using gevent patch solves.
from gevent.monkey import patch_all
patch_all(thread=False)
but has a Runtime Warning:
Patching more than once will result in the union of all True parameters being patched
Is there a better solution?
Hi @hu6360567.
Indeed, because MRQ uses gevent out of the box, you have to include that line to make the thread module behave correctly. You can safely ignore the warning.
Please note that we don't recommend using threads with MRQ, if you have a CPU-intensive task you should use multiple processes and IO-intensive tasks should use greenlets instead.
I wrote a Task Class with 2 subprcoess objects running client/server. It logs a status every 1 second while the subprocesses are running.
It works fine without sending it into the queue.
If I send it into a queue, it hangs at
task.runClient()
until it exists. The client runs the client subprocess and a thread to capture subprocess output.How should I write task to solve this problem?