I have a simple python process on a server A, which retrieves data from a server B.
Once the data is collected, I want to be able to send a websocket message to a javascript page, on a server C. Schematically:
A ---send data---> B -----send websocket message ---> C
How do I "dynamically" send a new websocket message to the server C? Is it possible to do so, or do I have to first receive a message from the Javascript page and then send a back response?
I'm using tornado, but I don't know how I'm supposed to instantiate the websocket.WebSocketHandler and call the write_message() function. In every example I see, there is no explicit instantiation of this class, e.g.:
app = web.Application([ ('/ws', WebSocketHandler, ), ]) # the class is just declared
How can I do this? Tornado looks really complex to me, as a newcomer to web development.
Thanks