-
Notifications
You must be signed in to change notification settings - Fork 118
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
next_message(timeout) gives NameError #12
Comments
There's a You should also read the tkinter ui script, which gives an idea of how to feed another event loop.(To run you need neovim/neovim#781)
👍 Will fix this now Before writing any significant amount of code that uses the python client, keep in mind that it is still alpha so some APIs will probably change. One task I already have in mind: rewrite it using twisted(for pypy support) and greenlets(for simplified concurrency while still keeping the familiar synchronous API)
As I said, the |
Thanks for the pointers. The I'm fully aware of the alpha status, in fact the main motivation was just to test the api and figuring out missing pieces. An IPython client is interesting in this stage I think, since it will implement async completion, live object introspection/documentation and other such "code intel" features. The fact that it almost is ready for real use for me and is much more responsive than vim-ipython (at least in my test cases) is just a pure bonus. (for instance it already supports async stdout and code completion). If this "alpha stage" api already enables this much, I can only imagine how awesome it is going to be when it is getting closer to "stable". 👍 |
@bfredl After the refactor the library should be more stable(it is still should be considered alpha though, at least until I fill some gaps in nvim plugin handling). I still need to write some high level documentation but here's some updates:
|
The from threading import Timer
t = Timer(5, lambda: vim.session.post('timeout'))
t.start()
print vim.session.next_message() |
Thanks, will try this out later. |
I'm trying to integrate the nvim-client event handling with the event loop of IPython (for interactive testing/introspection of plugins). The simplest way would be to call next_message with a very low time-out, but when I do
it gets the error
TimeoutError seems unfortunably not be defined in python2.x. Perhaps define neovim.TimeoutError when running in python2?
Also, the vim object could perhaps expose the fd of the underlying connection, that way the client could easily be efficiently integrated into any existing eventloop (by registering vim.next_message as callback for incoming data on the fd). (At least for my case that would be simpler than running the neovim eventloop in a separate thread)
The text was updated successfully, but these errors were encountered: