Skip to content

Commit

Permalink
Refactor _started to _consumers_started to avoid conflicts in cla…
Browse files Browse the repository at this point in the history
…sses that also extend `Thread` (#120)
  • Loading branch information
NeonDaniel authored Jan 24, 2025
1 parent 783abe9 commit 3595966
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neon_mq_connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(self, config: Optional[dict], service_name: str):
self._vhost = None
self._sync_thread = None
self._observer_thread = None
self._started = False
self._consumers_started = False

# Define properties and initialize them
self.sync_period = 0
Expand All @@ -122,7 +122,7 @@ def __init__(self, config: Optional[dict], service_name: str):

@property
def started(self):
return self._started
return self._consumers_started

@property
def config(self):
Expand Down Expand Up @@ -653,7 +653,7 @@ def run(self, run_consumers: bool = True, run_sync: bool = True,
if run_observer:
self.observer_thread.start()
self.post_run(**kwargs)
self._started = True
self._consumers_started = True

@property
def sync_thread(self) -> RepeatingTimer:
Expand Down Expand Up @@ -706,7 +706,7 @@ def stop(self):
self.stop_consumers()
self.stop_sync_thread()
self.stop_observer_thread()
self._started = False
self._consumers_started = False
LOG.info(f"Stopped Connector {self.service_name}")

def pre_run(self, **kwargs):
Expand Down

0 comments on commit 3595966

Please sign in to comment.