Beispiel #1
0
 def send_message(self, message):
     """
     Send message to the Browser.
     """
     with app("rabbit") as rabbit:
         rabbit.basic_publish(exchange=self._EXCHANGE,
                              routing_key=self.browser_uuid,
                              body=dumps(message))
Beispiel #2
0
 def engage_consumer(self, callback):
     with app("rabbit") as rabbit:
         rabbit.basic_consume(queue=self.queue,
                              auto_ack=True,
                              on_message_callback=callback)
Beispiel #3
0
 def send_message(self, message):
     with app("rabbit") as rabbit:
         rabbit.basic_publish(exchange=self._EXCHANGE,
                              routing_key=self.queue,
                              body=dumps(message))
Beispiel #4
0
 def create_queue(self):
     with app("rabbit") as rabbit:
         rabbit.queue_declare(queue=self.queue)
Beispiel #5
0
 def queue(self):
     with app("settings") as settings:
         return settings["backend_queue"]