We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm having trouble figuring out how I can nest async.wrap function calls.
async.wrap
What seems to be working is:
local leaf1 = async.wrap(function(cb) cb("leaf1") end, 1) local leaf2 = async.wrap(function(cb) cb("leaf2") end, 1) local branch = async.wrap(function(cb) local l1,l2 async.run(leaf1, function(val) l1 = val end) async.run(leaf2, function(val) l2 = val end) cb("branch" .. l1 .. l2) end, 1) function run() local root = async.void(function() print(leaf1()) print(leaf2()) print(branch()) end) root() end run()
I expected plain function calls to work, but they crash with an error:
local leaf1 = async.wrap(function(cb) cb("leaf1") end, 1) local leaf2 = async.wrap(function(cb) cb("leaf2") end, 1) local branch = async.wrap(function(cb) local l1,l2 l1 = leaf1() l2 = leaf2() cb("branch" .. l1 .. l2) end, 1) M.async = function() local root = async.void(function() print(leaf1()) print(leaf2()) print(branch()) end) root() end
Error:
attempt to yield across C-call boundary
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm having trouble figuring out how I can nest
async.wrap
function calls.What seems to be working is:
I expected plain function calls to work, but they crash with an error:
Error:
The text was updated successfully, but these errors were encountered: