-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
A client will use raw=True for performance purposes. WebSocketClient ignores this and parses messages using the inefficient json module purely for internal debugging purposes, while passing the unparsed message to the handler, which will need to be parsed again. This means that raw=True is actually slower.
It should be like this to avoid pointles parsing:
if not self.raw:
# we know cmsg is Data
msgJson = self.json.loads(cmsg) # type: ignore
for m in msgJson:
if m["ev"] == "status":
logger.debug("status: %s", m["message"])
continue
cmsg = parse(msgJson, logger)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working