-
Notifications
You must be signed in to change notification settings - Fork 196
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 async implementation not supported #204
base: develop
Are you sure you want to change the base?
Conversation
Hey @eastonsuo, thanks for your contribution! Could you explain when this is needed? |
I want to use asyncio in plugins, such as when do a async http request for another service, or wait for a asyncio.Event and blocked. (Maybe Endpoint should be changed to AsyncEndpoint to chieve that?) @ccordoba12
|
@@ -6,7 +6,7 @@ | |||
import os | |||
import socketserver | |||
import threading | |||
|
|||
import asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this to be on top of from functools import partial
and leave the blank line here.
I see, thanks for the explanation.
I'm not really sure. @andfoy, what do you think? |
@eastonsuo, could you please clarify your asynchronous case of use? We would assume that you would like to get multiple future objects instead of blocking on a call? |
yes, for example, I would like to post a request asynchronously within a call and on the other hand not blocking another call. I think it can be realized by an AsyncEndpoint and start server by asyncio.run() |
The idea of async handler is reasonable, but pylsp already start some threads to run hook handlers that may take time (e.g. linters). It may be reasonable to extend this so that all hook handlers have the option to be written as either However, this should not be implemented in the |
Agreed. I think the proper solution is to make the server fully async aware. |
No description provided.