Add AMQP websocket

This commit is contained in:
cuom1999 2023-08-21 17:27:21 -05:00
parent 752d21b500
commit c459226604
2 changed files with 201 additions and 2 deletions

View file

@ -16,7 +16,7 @@ class EventPoster(object):
def _connect(self):
self._conn = pika.BlockingConnection(
pika.URLParameters(settings.EVENT_DAEMON_AMQP)
pika.URLParameters(settings.EVENT_DAEMON_AMQP),
)
self._chan = self._conn.channel()
@ -25,7 +25,7 @@ class EventPoster(object):
id = int(time() * 1000000)
self._chan.basic_publish(
self._exchange,
"",
"#",
json.dumps({"id": id, "channel": channel, "message": message}),
)
return id