I'm developing a system that has two components - a Django web application and a monitor process.
The monitor process connects to a TCP/IP server somewhere and receives event indications using a proprietary protocol. It can also send commands to the server, again, with a proprietary protocol.
I want to run the monitor as a daemon. It will connect to the server and continuously monitor the incoming events. Whenever an event arrives, the monitor will update the database. The web application will get the current state from the database.
I'm a bit stuck with sending commands, though. I will need the Django web-app to somehow communicate with the monitor service. I can use Pyro, as recommended here, but I'd much rather use Celery, as I'm already using it for other parts of the system.
How can I get a Celery worker to both manage the monitor connection and serve Celery requests?
Note: Due to limitations of the proprietary protocol, I can't open two connections to the server, and so can't have one process monitor the event and another sending commands.