A
A
Artem Kislenko2017-05-15 06:03:53
Python
Artem Kislenko, 2017-05-15 06:03:53

How to communicate between processes?

Hello!
There is such a task:
1. The client starts data processing
2. Tornado receives a request from the client and starts a heavy and long process.
How to start this process correctly?
Now everything is implemented in this way:
1. A heavy process is called through threads, a certain identifier is passed there as a parameter
2. Next, periodic requests are made via js to another url with an identifier
passed 3. tornado makes a request to the database to track progress (respectively, that long process, writes something to the database using the identifier passed earlier)
Unfortunately, redis and the like cannot be used.
Is this architecture correct? Maybe there are other more canonical solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2017-05-15
@devspec

The best solution would be to use Message Queue.
Write down the task in one queue, listen to the second for an answer.
The process reads from the first queue and writes to the second.
You can look towards https://www.rabbitmq.com/

E
Eugene, 2017-05-15
@immaculate

As far as I understand it is possible to use PostgreSQL LISTEN/NOTIFY (if PostgreSQL is used): https://www.postgresql.org/docs/current/static/sql...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question