Skip to content

Commit

Permalink
fixup! In sal_info.py, refactor SalInfo to use the KafkaConsumer clas…
Browse files Browse the repository at this point in the history
…s in a separate process to handle reading data.
  • Loading branch information
tribeiro committed Feb 13, 2025
1 parent 0c3f625 commit e7036f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/lsst/ts/salobj/sal_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,16 @@ async def _read_loop(self) -> None:

try:
while self.isopen:
data = await self.loop.run_in_executor(self.pool, self._data_queue.get)
if self._data_queue.empty():
data = await self.loop.run_in_executor(
self.pool, self._data_queue.get
)
else:
data = self._data_queue.get_nowait()

if data is None:
break

kafka_name, data_dict = data
if data_dict is None:
self.log.info("Started.")
Expand Down

0 comments on commit e7036f9

Please sign in to comment.