# Signals typed events, Connection handles, once-listeners and weak cleanup ```{raw} html ▶ Run in browser ``` **Tags:** `basics` `signals` `events` An Emitter node declares a typed `Signal(int)` class attribute. Each SPACE press emits a tick to its listeners and every delivery is appended to an on-screen log built from Text2D lines. One listener is connected with `once=True` and spends itself on the first emit; the root listener can be detached and re-attached live via its `Connection` handle; and an Echo node holds a bound-method connection that cleans itself up when the node is freed. ## What it demonstrates - `Signal(int)` as a class attribute: each instance lazily gets its own signal, so listeners on one emitter never hear another. - `connect(fn)` returns a `Connection`; `conn.disconnect()` detaches it and `conn.connected` reports the state. - `connect(fn, once=True)`: the listener auto-disconnects after one emit. - Bound methods on Nodes are held weakly: freeing the node cleans the connection up and a later emit simply skips it, with no crash. Controls: SPACE - emit ticked(n) D - disconnect / reconnect the root listener via its Connection F - free the Echo node (its bound-method connection auto-cleans) ESC - quit Run: uv run python examples/features/basics/signals.py Headless self-check: uv run python examples/features/basics/signals.py --test ## Source ```{literalinclude} ../../examples/features/basics/signals.py :language: python :linenos: ```