diff --git a/ldclient/impl/stubs.py b/ldclient/impl/stubs.py index 897bbc3d..58b7193f 100644 --- a/ldclient/impl/stubs.py +++ b/ldclient/impl/stubs.py @@ -16,9 +16,6 @@ def start(self): def stop(self): pass - def is_alive(self): - return False - def send_event(self, event): pass @@ -36,9 +33,6 @@ def start(self): def stop(self): pass - def is_alive(self): - return False - def initialized(self): return True @@ -54,9 +48,6 @@ def start(self): async def stop(self): pass - def is_alive(self): - return False - def send_event(self, event): pass diff --git a/ldclient/interfaces.py b/ldclient/interfaces.py index 0ecd6026..a6b30278 100644 --- a/ldclient/interfaces.py +++ b/ldclient/interfaces.py @@ -526,37 +526,25 @@ async def initialized_internal(self) -> bool: # not declared here as required methods. -# Internal use only. Common methods for components that perform a task in the background. -class BackgroundOperation: +class UpdateProcessor(ABC): + """ + Interface for the component that obtains feature flag data in some way and passes it to a + :class:`FeatureStore`. The built-in implementations of this are the client's standard streaming + or polling behavior. For testing purposes, there is also :func:`ldclient.integrations.Files.new_data_source()`. + """ - # noinspection PyMethodMayBeStatic def start(self): """ - Starts an operation in the background. Should return immediately and not block. + Starts the update processor in the background. Returns immediately and does not block. """ pass def stop(self): """ - Stops an operation running in the background. May return before the operation is actually stopped. + Stops the update processor. Can return before the background work stops. """ pass - # noinspection PyMethodMayBeStatic - def is_alive(self) -> bool: - """ - Returns whether the operation is alive or not - """ - return True - - -class UpdateProcessor(BackgroundOperation, ABC): - """ - Interface for the component that obtains feature flag data in some way and passes it to a - :class:`FeatureStore`. The built-in implementations of this are the client's standard streaming - or polling behavior. For testing purposes, there is also :func:`ldclient.integrations.Files.new_data_source()`. - """ - def initialized(self) -> bool: # type: ignore[empty-body] """ Returns whether the update processor has received feature flags and has initialized its feature store. diff --git a/ldclient/testing/mock_async_components.py b/ldclient/testing/mock_async_components.py index c2654ef1..02462f32 100644 --- a/ldclient/testing/mock_async_components.py +++ b/ldclient/testing/mock_async_components.py @@ -77,6 +77,3 @@ async def stop(self): def initialized(self) -> bool: return True - - def is_alive(self) -> bool: - return True diff --git a/ldclient/testing/stub_util.py b/ldclient/testing/stub_util.py index 28b11758..eed42571 100644 --- a/ldclient/testing/stub_util.py +++ b/ldclient/testing/stub_util.py @@ -68,9 +68,6 @@ def stop(self): def start(self): self._running = True - def is_alive(self): - return self._running - def send_event(self, event): self._events.append(event) @@ -176,9 +173,6 @@ def start(self): def stop(self): pass - def is_alive(self): - return True - def initialized(self): return True