Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yield support for web sockets and requests #113

Open
sansyrox opened this issue Nov 28, 2021 · 0 comments
Open

Yield support for web sockets and requests #113

sansyrox opened this issue Nov 28, 2021 · 0 comments

Comments

@sansyrox
Copy link
Member

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.

@sansyrox sansyrox changed the title Async support for web sockets Yield support for web sockets and requests Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant