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

Proper use of threads in plugins? #352

Open
mcmire opened this issue Aug 1, 2018 · 2 comments
Open

Proper use of threads in plugins? #352

mcmire opened this issue Aug 1, 2018 · 2 comments
Labels

Comments

@mcmire
Copy link

mcmire commented Aug 1, 2018

So I'm trying to use this plugin which interfaces with a server over TCP. The plugin works fine when sending data, but when receiving data it apparently causes the Python part of Neovim to abort, in a fashion very similar to (if not exactly like) #254. I believe that the line in this plugin that's causing this is here: https://github.com/timburgess/extempore.vim/blob/master/python/extempore3.py#L18. As you can see, a thread is kicked off every 0.3 seconds in the connect function to read from the socket. When I remove usage of the function where this thread business is happening then all is well.

I don't know Python very well, so I was wondering whether one of you would know off-hand why this isn't working or whether there's a better way to do this.

@justinmk
Copy link
Member

justinmk commented Aug 10, 2018

As always, we need exact versions of python and nvim that you're using. I read here :

don't use asyncio before Python 3.5.3. There is a incredibly major bug with "asyncio.get_event_loop()" that makes it unusable for anything that involve mixing threads and loops

@bfredl I wonder if we should not use asyncio before python 3.6 3.5.3

@bfredl
Copy link
Member

bfredl commented Aug 10, 2018

I wonder if we should not use asyncio before python 3.6

@justinmk Except that it says "before 3.5.3". Distros should supply bugfix releases even if they are stuck on an older feature release. 3.5 is three years old, and even debian stable has it (3.5.3), it doesn't seem me an immodest requirement for doing fancy IO stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants