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

Wb sockets protocol specification deviated #219

Open
npradeep357 opened this issue Nov 22, 2021 · 3 comments
Open

Wb sockets protocol specification deviated #219

npradeep357 opened this issue Nov 22, 2021 · 3 comments

Comments

@npradeep357
Copy link

Hi,

According to Web Sockets specification, there can be 'n' clients which needs 'n' pygls instances. According to the current implementation, only once connection can be supported properly for one pygls process. And it is not practical to start a new WS process every time I need attach a new client.

This can be enhanced (or in fact rectified) by simply providing new pygls instance (object) for every new connection instead of pointing to the same self.lsp instance.
ref: code

we can maintain a list of tuples (websocket, pygls instance) for every new connection and should be managed by the same.

More over this cannot be handled in the same way TCP or IO as there will be only one instance per process in these cases, but in WS case, we need multiple in single process.

@npradeep357 npradeep357 changed the title Wb sockets protocol spec deviated Wb sockets protocol specification deviated Nov 22, 2021
@npradeep357
Copy link
Author

more details over here: jedi-language-server issues #173

@tombh
Copy link
Collaborator

tombh commented Dec 3, 2022

Sorry for the late reply. Could you give a use case or example of this issue? I don't doubt its usefulness, just want to understand it better. Thank you.

@npradeep357
Copy link
Author

Sorry for the late reply. Could you give a use case or example of this issue? I don't doubt its usefulness, just want to understand it better. Thank you.

Currently this only supports one live WS client at any point. To use this with multiple clients in parallel, you need to create multiple WS servers which is not ideal.

Problem is that the WS server is tightly coupled with pygls object/instance. Separate this and make sure that multiple pygls instances can be called from WS server.

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

2 participants