Do Signals in Godot 4 come with any delivery guarantee?

Hello everyone, kinda new to Godot and in early stages for my hobby project.
I guess/hope this is an easy answer for people in the know :slight_smile:

Godot Version

4.3

Question

As my project will rely on Signals, message hub and the hole shebang I was wondering with what kind of guarantee the built-in signals operate, if any?

To clarify, common types of guarantees are
a. At-most once
b. At-least once
c. Exactly-once

The idea of guarantees with messages is explained here, for instance.

I didn’t find this specific topic mentioned in the docu about signals.

Thanks in advance! /Carsten

Signals are delivered immediately.

2 Likes

signals act very similar to array with callables. When you use ‘connect’ its similar to add this callable to signal array, and when something triggers it, then signal just make .call(arg) to every callable inside. That means callables called immediately or may called deferred if special flag is used.
So if you have a script that do Node.signal_name.emit() and code after it, connected callables are executed before the code that goes after Node.signal_name.emit() part

1 Like

Thanks but not an answer to my question.

Thank you but doesn’t answer my question, I think?

Exactly-once.

func _ready():
do_action()

is same thing to

Node.ready.connect(do_action)

but only difference that you can use flags to make it for instance called once (bit flag 4)

once again - signals are arrays that use .call() on connected callables when triggered

1 Like

Thank you very much!