Utilities¶
General-purpose utilities for redsun.
Exposes:
- find_signals - locate named signals in a VirtualContainer.
find_signals
¶
find_signals(
container: VirtualContainer,
signal_names: Iterable[str],
owner: str | None = None,
) -> dict[str, SignalInstance]
Find signals in a VirtualContainer by name, optionally scoped to an owner.
The registry is keyed by owner first (container.signals[owner][signal]),
since components may expose signals of the same name. Pass owner to scope
the lookup to one component; omit it and every cache is searched, first
match per name winning. Names not found are omitted rather than raising.
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 |
owner
|
str | None
|
Registry key of the owning component (its |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, SignalInstance]
|
Mapping of signal name to signal instance for each name found. Names that are not found are omitted. |