2

currently, I have a little script that receives a lot of information through various channels using ZeroMQ PUB-SUB sockets.

What i want to do is: receive the info with zmq, process it, and then, send it away through a WebSocket, in order to be able to use it in an AngularJS application, displaying real time information.

All the websocket libraries i have found for python work in an asynchronous way, where i can send messages as a responde to a message the browser send in advance. I don't want to send messages as a response, i want to stream all the information I am receiving, for any instance of my AngularJS app that might be running.

Thanks in advance.

EDIT: I forgot something. I found this How do I stream data through a flask application?, and got it working with flask, but it seems to only work with the flask app from which the websocket is created, i can't connect to it from angular.

1 Answer 1

0

One good example is on Miguel Grinberg blog here. He creates a flask backend and uses Angular on front-end.

After the browser open the channel, the back end can send messages any time, without any constraints related to timing.

1
  • Thanks! I had already read that example, but i hadn't really checked the full git repo. There was an example on how to spawn threads that can do other stuff, and send the information generated through the websocket, which is exactly what i was looking for. Jan 8, 2018 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.