Open Shadowblitz16 opened 2 years ago
But this is how it already works... When you emit a signal, all connected methods are called immediately, unless you connect them with DEFERRED flag.
They are called immediately, but you need to manually do some black magic if you want stuff to happen on/after the last one happens.
No, the code after emit is executed after all calls are finished.
Aah, nice trick that isn't documented well enough
No, the code after emit is executed after all calls are finished.
Only synchronous part (before the first yield
/await
).
Well, if something is called asynchronously in a signal callback (e.g. using deferred call), there is no way to tell that it was called from a signal. You should use a second signal in such cases.
But this is how it already works... When you emit a signal, all connected methods are called immediately, unless you connect them with DEFERRED flag.
If this is the case then its a bug. Right now it executes immediately even if I yield on connected signals
also even if they are called immediately it doesn't mean they will finished immediately, the connected signals could have yield code
Well, if something is called asynchronously in a signal callback (e.g. using deferred call), there is no way to tell that it was called from a signal. You should use a second signal in such cases.
This isn't really a good idea either it introduces coupling of nodes, the point was that it may not have a signal connected to it and in that case it resets.
Describe the project you are working on
Spaceship game
Describe the problem or limitation you are having in your project
I am creating a menu and I need to wait till all the functions connected to a emitted signal are finished
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow us to yield on a signal and wait for it to finish
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
It would probably be used in networking if supported, also I think it can be worked around but it requires something like this...
Is there a reason why this should be core and not an add-on in the asset library?
It helps avoid node coupling It could be used in networking too.