taskforcesh / bullmq

BullMQ - Message Queue and Batch processing for NodeJS and Python based on Redis
https://bullmq.io
MIT License
6.14k stars 402 forks source link

A method to get the child values when using flows in Python #2736

Open lahdekorpi opened 2 months ago

lahdekorpi commented 2 months ago

I tried to mix Node.js and Python for a complex flow with multiple children and grandchildren, passing the data using job.getChildrenValues successfully between Node.js workers.

But that method doesn't exist in Python? Is there an alternative to fetch the data produced by the child?

lahdekorpi commented 2 months ago

At the moment I just hacked it together with this:

conn = job.queue.client
# Construct the processed key
processed_key = f"bull:{job.queue.name}:{job.id}:processed"
# Fetch data from Redis using the processed key
processed_data = await conn.hgetall(processed_key)

It works but this is amazingly hackish.