diff --git a/pdf_agents/agents.py b/pdf_agents/agents.py index 71b023c..39a7f11 100644 --- a/pdf_agents/agents.py +++ b/pdf_agents/agents.py @@ -336,6 +336,8 @@ def tell(self, x, y) -> Dict[str, ArrayLike]: class PDFReporterMixin: """Mixin for sending reports to Kafka as well as Tiled. + This wraps every report in a single run because downstream agents operate per-run instead of per-event. + This behavior is similar to the pdfstream service. Parameters ---------- @@ -357,6 +359,7 @@ def generate_report(self, **kwargs): uid = self._write_event("report", doc) self._report_producer("report", doc) logger.info(f"Generated report. Tiled: {uid}\n Kafka: {doc.get('uid', 'No UID')}") + self.close_and_restart(clear_tell_cache=False, retell_all=False, reason="Per-Run Subscribers") @classmethod def get_beamline_objects(cls) -> dict: