I have a script which is subscribed to RMQ channel and it should spawn a new process with long-playing IO task if it gets some special kind of messages. And after this it should be terminated.
I've very simple function which tries to spawn worker:
async def spawn_worker(self):
p = multiprocessing.Process(target=long_plaing_task)
p.start()
p.join()
result = await p.get_a_result_somehow()
p.kill()
I have never worked with multiprocessing so my question is simple and maybe stupid: how should a get that result from the spawned process? I found this question and answer to use Queues. But is this the only way to get a result or there are some more convinient ways?