You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python environment has grown significantly with the advent of asyncio. The ability for Lua to cleanly interact with Python Coroutines (IE: async def func():) would be a golden addition to Lupa.
I have done some experimenting and realized that it is possible to achieve interaction of a sorts - for it to work, Lua must coroutine.yield() a Python coroutine, and whatever managing environment that called lua_coro.send() must be asynchronous.
etc. Throw that asyncio.iscoroutine into a while loop and you could have an environment which continuously 'awaits' values.
But this isn't very convenient or intuitive.
when working in Lua, what would be great is if you could call a function/method, like ... obj:getAttribute("strength") and for Lupa to realize 'oh, it's calling a Python coroutine. I should await.' you could have something like an asynchronous version of lua_coro.send() which does this for you.
I might be willing to work on a PR for this myself if I know if the feature would be welcome. Admittedly I've never touched Cython before so I'm a bit daunted.
The text was updated successfully, but these errors were encountered:
The Python environment has grown significantly with the advent of asyncio. The ability for Lua to cleanly interact with Python Coroutines (IE: async def func():) would be a golden addition to Lupa.
I have done some experimenting and realized that it is possible to achieve interaction of a sorts - for it to work, Lua must coroutine.yield() a Python coroutine, and whatever managing environment that called lua_coro.send() must be asynchronous.
etc. Throw that asyncio.iscoroutine into a while loop and you could have an environment which continuously 'awaits' values.
But this isn't very convenient or intuitive.
when working in Lua, what would be great is if you could call a function/method, like ...
obj:getAttribute("strength")
and for Lupa to realize 'oh, it's calling a Python coroutine. I should await.' you could have something like an asynchronous version of lua_coro.send() which does this for you.I might be willing to work on a PR for this myself if I know if the feature would be welcome. Admittedly I've never touched Cython before so I'm a bit daunted.
The text was updated successfully, but these errors were encountered: