Is there a simpler way to instantly invalidate a function?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MichiruNakam

I’m abusing of yield and signals. However, there are situations that some of my methods are yielding (and invalidating) only when certain conditions are met, otherwise do nothing.
Since the calling method of those methods are yielding those, I invalidate those no matter the conditions (because an exception occurs when yielding a method that does not invalidate) by doing yield(get_tree().create_timer(0), "timeout") when the methods does nothing, but needs to be invalidated. Is there a more elegant way of instantly invalidating a function without doing this every time?

:bust_in_silhouette: Reply From: rakkarage
yield(get_tree(), "idle_frame")