Answer the question
In order to leave comments, you need to log in
How to properly organize getting data from mongo?
Good afternoon, there is a task when updating data in the database to send them via websocket to the client.
The difficulty lies in the fact that the data is filled with a separate script.
Answer the question
In order to leave comments, you need to log in
You don't have many options:
1) Send sockets at the end of your script execution;
2) Save information, for example, with the value {"use": False}, check for updates by the server side and then send it to the client side.
Make an asynchronous worker on asyncio / tornado / gevent, run zmq there to receive messages from the script and websocket to communicate with the client, you can also send messages to the client from the web application. There will be something like:
Script --(zmq)--> async_server --(ws)--> Client
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question