Raxit Sheth
Raxit Sheth

Reputation: 2601

Producer/Consumer + Worker arch with Node.js/python

We are having 2 components 1 Producer/Consumer, 2 Process

Producer/Consumer is i/o incentive, and nothing but take web request and make entry to mongodb based on input params.

Process is separate process (in python) which process data from mongodb and group(make pair) them.

This pairing can take little time, and once pairing is done, we want to notify Node that for given connection, "Process is done", so node can send data back to client.

I am not sure on "How to notify Node's connection that process is done, and this is the output."

Upvotes: 1

Views: 689

Answers (1)

sean
sean

Reputation: 3985

I would use a message passing service such as RabbitMQ or even ZeroMQ to notify or have the Node.JS process poll for this notification.

So, the Python process would do it's processing then it would send a message out and from there the Node.JS process would read this message then know that it can do its job and process the data in MongoDB.

Upvotes: 1

Related Questions