lua-async-await
lua-async-await copied to clipboard
Async Await in 90 lines of code.
Sorry if I've got this completely wrong! I don't think the expected printed values of the sync coroutines function `thread` match up. https://github.com/ms-jpq/lua-async-await/blob/a54c07887056999fe44b642e7124381a8dcbaefd/README.md#L118-L123 https://github.com/ms-jpq/lua-async-await/blob/a54c07887056999fe44b642e7124381a8dcbaefd/README.md#L128
Simple example: ```lua local do_thing = a.sync(function (val) local o = 10 return o + val end) print(do_thing(5)) ``` This should print `15`, but instead it results in an error...
See https://github.com/MarcWeber/neovim-luajls Whether fixing this library is worth it or not up to author See #9
If you come from JS world you expect await to await a promise. Thus awaiting multiple times should yield the same result. A mature promise library seems to be this....
Hello @ms-jpq , thanks again for the lovely code and tutorial. It is helping me slowly get my head around asynchronous programming. Can you tell me how you would call...
Lua specifies tail calls as part of the language, which can be taken advantage of in the code presented. However, having function A calling function, B right at the end,...