I’ve set up a python websocket client with Autobahn and would like to control it via Celery dispatched tasks. For example, I’d like to be able to dispatch a task to Celery and have it send a message on the open websocket.
Since Celery and Twisted each have their own event loops I’m having trouble getting the two to talk to each other. Would my best approach be to create a Twisted protocol that opens a (unix) socket and then use that socket to talk between the Celery process and the Autobahn process? (i.e. when my Celery worker handles a task it sends a message along the unix socket to the Twisted protocol, the Twisted protocol then talks to Autobahn and tells it to send a message on the websocket).
Alternatively, if anyone has a suggestion for a better way to control the websocket client from a remote process or server using message queues or some other technology, I’m all ears.