示例#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))
示例#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)
示例#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))
示例#4
0
 def create_queue(self):
     with app("rabbit") as rabbit:
         rabbit.queue_declare(queue=self.queue)
示例#5
0
 def queue(self):
     with app("settings") as settings:
         return settings["backend_queue"]