plenary.nvim
plenary.nvim copied to clipboard
C-call boundary error in async run
I am getting errors while using the oneshot channel like in the readme. Here a minimal example I tested:
Test = function()
local async = require'plenary.async'
local tx, rx = async.control.channel.oneshot()
a.run(function()
tx("sending...")
end)
local result = rx()
print(result)
end
I get the following error:
E5108: Error executing lua /home/koopa/.config/nvim/lua/utils.lua:81: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'rx'
/home/koopa/.config/nvim/lua/utils.lua:81: in function 'Test'
[string ":lua"]:1: in main chunk
nvim version:
NVIM v0.7.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Features: +acl +iconv +tui
Not a maintainer, just a user. All of the examples are written to be wrapped in asyncio.run. You can use asyncio.run as in this example to run an async function without awaiting it in the current async function.
@rcarriga A quick search for ´asyncio` in the repo didn't return any results. Can you give me a simple example how this would look like?
Ah sorry had my Python hat on :sweat_smile: Meant just async as in require("plenary.async").