rtvi: deprecate RTVI.observer()

This commit is contained in:
Aleix Conchillo Flaqué
2025-02-07 09:19:43 -08:00
parent 03ac744bcf
commit 510a0f5ef5
4 changed files with 16 additions and 4 deletions

View File

@@ -812,6 +812,15 @@ class RTVIProcessor(FrameProcessor):
self._register_event_handler("on_client_ready")
def observer(self) -> RTVIObserver:
import warnings
with warnings.catch_warnings():
warnings.simplefilter("always")
warnings.warn(
"'RTVI.observer()' is deprecated, instantiate an 'RTVIObserver' directly instead.",
DeprecationWarning,
)
return RTVIObserver(self)
def register_action(self, action: RTVIAction):