-
Notifications
You must be signed in to change notification settings - Fork 123
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
non-blocking next_message (peek_message) #214
Comments
Peek usually doesn't pop. Perhaps |
Peek is the most general API, as
but of course we can have both. |
Chiming in for a me too:). I'm trying to implement a plugin for GhostText and basically need two workers that both need to be on the main thread since they call nvim apis. I don't have a good understanding of the underlying libuv event loop - but as of now, I'm running into all sorts of problems because nvim.next_message() blocks. I've tried python threads and gevent greenlets but basically pulling my hair out now :) An alternative may be to provide a For my case, I even tried to implement the approach alluded to there by having a timer job post a notification so that next_message gets unblocked - but even that is flaky at best. It would also help a lot to have some documentation on dos and donts of usage - esp for folks who don't fully grok the libuv event loop. |
The most scalable way to integrate multiple event sources and yieldable workers is to use the event loop |
@bfredl thanks.. can you point me to some more documentation/details on how to use nvim.run_loop? |
So I tried to Just looking for somsalksjfe advice on how to use the python client. Is it better to just use threads while working with the python client? (I need to start a http server and on each request from the browser, start a websocket server. When a message arrives at the websocket channel, I need to open a buffer in nvim and whenever the buffer is modified, push back the modified text to the websocket channel. Thanks for reading. |
Literally mixing with gevent code will likely never work, what I meant is that it implements a gevent-like abstraction: you typically don't need to suspend and resume greenlets yourself, rather, when you do |
Got it. By the way, can I start multiple nvim.run_loop - one per thread? |
I think you can, but you must have then created different |
No description provided.
The text was updated successfully, but these errors were encountered: