surfaces.observer
Observer Mixin
Provides a reusable subscribe/notify observer pattern. Surfaces use this to propagate material-change events to downstream surfaces.
deepcopy contract: _subscribers is cleared on copy. The new object starts with no subscribers. SurfaceGroup._rewire_observers() re-establishes subscriptions after any deepcopy of a SurfaceGroup.
Kramer Harrison, 2026
Classes
Mixin providing subscribe/notify observer pattern. |
- class ObserverMixin[source]
Mixin providing subscribe/notify observer pattern.
- Classes inheriting from this mixin gain:
subscribe(callback)— register a callbackunsubscribe(callback)— deregister a callback_notify()— call all live subscribers
deepcopy contract:
_subscribersis cleared on copy. The owning container (e.g. SurfaceGroup) is responsible for re-wiring subscriptions after copy via_rewire_observers().