You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
defhello_world():
return"Hello, world!"# this should execute every timeasyncdefhello_world():
awaitxyz() # called onceawaitzya() # called once
This can be give a more considerate thought in the future.
Moreover, we can also check continuous responses using yield.
The text was updated successfully, but these errors were encountered:
sansyrox
changed the title
Async support for web sockets
Yield support for web sockets and requests
Dec 20, 2021
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.
This can be give a more considerate thought in the future.
Moreover, we can also check continuous responses using
yield
.The text was updated successfully, but these errors were encountered: