change sleep in channel send to 0
This commit is contained in:
parent
f268187e9b
commit
4aa4c6f49d
@ -104,14 +104,9 @@ class WebSocketChannel:
|
|||||||
logger.info(f"Connection for {self} timed out, disconnecting")
|
logger.info(f"Connection for {self} timed out, disconnecting")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Without this sleep, messages would send to one channel
|
# Explicitly give control back to event loop as
|
||||||
# first then another after the first one finished and prevent
|
# websockets.send does not
|
||||||
# any normal Rest API calls from processing at the same time.
|
await asyncio.sleep(0)
|
||||||
# With the sleep call, it gives control to the event
|
|
||||||
# loop to schedule other channel send methods, and helps
|
|
||||||
# throttle how fast we send.
|
|
||||||
# 0.01 = 100 messages/second max throughput
|
|
||||||
await asyncio.sleep(0.01)
|
|
||||||
|
|
||||||
async def recv(self):
|
async def recv(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user