This release of web sockets will not have support for async functions.
Reason:
I was trying to implement async support in the traditional way. i.e. execute the entire async function in the process pool.
However, we must realise that WebSockets are different from HTTP requests in the way that sending the response to every await to the websocket clients will make sense. If the await returns None
, the clients can choose to not do anything.
e.g.
def hello_world():
return "Hello, world!" # this should execute every time
async def hello_world():
await xyz() # called once
await zya() # called once
This can be give a more considerate thought in the future.
Moreover, we can also check continuous responses using yield
.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too