DaveTheCoder
This does not fix. I need a watchdog that will terminate and recapitulate the function on its behalf.
This await handler() will return either the content of await awaitable() if it return in viable time, or if timed-up, a error.
But all this needs to be on the oneliner of the await handler()
The problem is how to have 2 concurrent awaits inside a function, or how to break from one.
func handler():
var toreturn = await awaitable()
#UNREACHABLE PSEUDOCODE BELLOW
#ASSUMING awaitable never returned and this is valid:
if toreturn !=null:
return toreturn
await get_tree().create_timer(5).timeout
return false
The idea is to have the await handler() either return the valid await awaitable() content, OR, after 5 seconds, when the "PSEUDOCONCURRENT" await get_tree().create_timer(5).timeout is emited, break from the await awaitable() and returns the false.
This is the behaviour i am seeking.
How to have this "pseudoconcurrent await", and lissen to the first, and free the other?
in other words, a await behaves just kinda a "lambda function signal conection" being conected on declaration.
The problem is that it hangs until the signal is emited, and that is the intended behaviour
what i need is the rest of the aprouch, and have the " lambda function signal disconect", and thus, stop waiting for it and un-hanging the flow of the code.