Fix blocking events (#1198)

This commit is contained in:
Nikhil Rao 2023-06-15 23:47:07 -07:00 committed by GitHub
parent 8500a8444a
commit f9956cde1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -662,7 +662,9 @@ class EventNamespace(AsyncNamespace):
# Process the events.
async for update in process(self.app, event, sid, headers, client_ip):
# Emit the event.
await self.emit(str(constants.SocketEvent.EVENT), update.json(), to=sid) # type: ignore
await asyncio.create_task(
self.emit(str(constants.SocketEvent.EVENT), update.json(), to=sid)
)
async def on_ping(self, sid):
"""Event for testing the API endpoint.