-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Fix websocket based servers #269
Conversation
Oh, so does this mean that nobody in the wild is actually using Pygls with websockets? I could recreate the bug, but I didn't get the deprecation warning. Looking at the docs, do you think the deprecation warning is for favouring async/await? |
27f8480
to
a1a230c
Compare
Potentially... or maybe not that many people have upgraded to pygls
There is a note in the changelog saying the |
Ah yes Ok, so the |
The main one I'm aware of is web browsers can speak websockets natively, so you can hook up a pygls server running somewhere with some web based ui - like the Monaco Editor.
Not currently... the
I think it's because there's nothing in |
Ohh yes of course, and that's potentially connected to your Pyodide work too?
Sure, working for the near term is 1000% better than not working at all! Oh, hadn't heard of Sans-IO.
I was wondering if an async function automatically invoked some kind of internal event loop magic in the background. But anyway, let's not worry about it for now. |
Not really... websockets allow you to build a more traditional client-server application with your backend either running locally on your machine or some remote server. Pyodide lets us run the server part direct in the webpage - no separate backend required |
I see, thanks for the clarification :) Are you waiting on a review? |
Yes, that would be good thanks :) |
Oh, what happened here? Did I forget to review after you asked me to? I'm really sorry if that's what happened 😞 |
Not your fault 😄 the review happened, but I never followed it up with a merge |
Oh 😅 |
This is an attempt at fixing #268
First this commit introduces a test that runs a websocket server in a separate thread.
Note: While the test appears to work as intended, due to running the server in a separate thread I'm unable to reproduce the exact error I see in the original issue. I instead get a different error about there not being an event loop.
Next, the fix appears to work as I'm able to use websocket based servers with it, but it appears to rely on deprecated features.
Code review checklist (for code reviewer to complete)