pynvim icon indicating copy to clipboard operation
pynvim copied to clipboard

Integration with asyncio

Open rr- opened this issue 4 years ago • 1 comments

Related: #488

Let's say I already am running my own event loop (in my particular case it's quamash). How can I integrate this with nvim.run_loop()? As far as I see it ultimately calls pynvim.msgpack_rpc.event_loop.asyncio.AsyncioEventLoop._run:

    def _run(self):
        while self._queued_data:
            self._on_data(self._queued_data.popleft())
        self._loop.run_forever()

Needless to say calling this function is blocking my application, and calling it in a separate thread sprinkles lots of errors about cross-thread calls. Even if I tried to put everything in the same thread, it is unknown how to interact with self.nvim considering how self.nvim.run_loop is blocking.

rr- avatar Jul 01 '21 20:07 rr-

related https://github.com/neovim/pynvim/issues/352 https://github.com/neovim/pynvim/issues/342 https://github.com/neovim/pynvim/issues/324 https://github.com/neovim/pynvim/issues/323

justinmk avatar Jul 03 '21 14:07 justinmk