refactor: Change MuxRPC.__await__ MuxRPC.process_messages
`__await__` can be a bit dangerous in the world of `asyncio`.
This commit is contained in:
@@ -155,11 +155,15 @@ class MuxRPCAPI:
|
||||
self.handlers = {}
|
||||
self.connection = None
|
||||
|
||||
async def __await__(self):
|
||||
async def process_messages(self):
|
||||
"""Continuously process incoming messages"""
|
||||
|
||||
async for req_message in self.connection:
|
||||
body = req_message.body
|
||||
|
||||
if req_message is None:
|
||||
return
|
||||
|
||||
if isinstance(body, dict) and body.get("name"):
|
||||
self.process(self.connection, MuxRPCRequest.from_message(req_message))
|
||||
|
||||
|
Reference in New Issue
Block a user