Closed RadiantUwU closed 1 year ago
It kinda looks like calls to lua_resume
will yield the GDScript code.
The resume methodnon LuaCoroutine is a blocking call. It will not return until either lua yields and is done executing.
If yield_await is called in a GDScript method that's exposed to lua. It will yield thd GDScript method. This is still experimental though.
If yield_await is called in a GDScript method that's exposed to lua. It will yield thd GDScript method. This is still experimental though.
So basically it turns the running GDScript function into a coroutine?
The only thing that's needed is to update documentation saying its a blocking call. (for resume()
)
So basically it turns the running GDScript function into a coroutine?
Kind of yeah, its the same as using await anywhere else in GDSCript and having the lua coroutine yield. but when the corutine is resumed it will instead resume where await was called.
There is a code example of how it works here .
The only thing that's needed is to update documentation saying its a blocking call. (for
resume()
)
And yeah that is probably a good idea. There is probably a lot of examples where documentation is not as clear as it should be. I always welcome help with it but I do plan on going through all off it again before the v2 stable release. Which I hope to make happen before godot 4.1 is stable.
Fixed in #125
It's not clear whether the thread object that calls .resume() on the coroutine stops for it or not. What happens exactly when .resume() is called?