Utilities¶
General-purpose utilities for redsun.
Currently exposes find_signals, a helper for locating named signals
in a VirtualContainer without needing to know the owner's instance name.
find_signals
¶
find_signals(
container: VirtualContainer, signal_names: Iterable[str]
) -> dict[str, SignalInstance]
Find signals in a VirtualContainer by name, regardless of owner.
Searches all registered signal caches for each name in signal_names and returns the first match found. Names not present in any cache are omitted from the result.
This helper avoids coupling callers to the owner's instance name, which is assigned at runtime by the application container.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container
|
VirtualContainer
|
The virtual container holding registered signals. |
required |
signal_names
|
Iterable[str]
|
Signal names to look up (e.g. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, SignalInstance]
|
Mapping of signal name to signal instance for each name found. Names that are not found in any cache are omitted. |