send messages async
This commit is contained in:
@@ -137,7 +137,7 @@ class ApiListener(Node):
|
|||||||
while True:
|
while True:
|
||||||
if len(self.message_queue) > 0 and self.websocket is not None and self.event_loop is not None:
|
if len(self.message_queue) > 0 and self.websocket is not None and self.event_loop is not None:
|
||||||
# self.get_logger().info("sending message")
|
# self.get_logger().info("sending message")
|
||||||
asyncio.ensure_future(self.publish_message(self.message_queue.pop(0)), loop=self.event_loop)
|
asyncio.run(self.publish_message(self.message_queue.pop(0)))
|
||||||
|
|
||||||
def start_api_thread(self):
|
def start_api_thread(self):
|
||||||
asyncio.run(self.handle_api())
|
asyncio.run(self.handle_api())
|
||||||
|
|||||||
Reference in New Issue
Block a user