From ab56c9a173330fda13c0dd5b1b73cc40f66db9e7 Mon Sep 17 00:00:00 2001 From: Matthias Bisping Date: Tue, 24 May 2022 14:39:39 +0200 Subject: [PATCH] added todo comment for modifying acknowledging logic at some point to allow input buffering to take effect --- pyinfra/default_objects.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyinfra/default_objects.py b/pyinfra/default_objects.py index 496ced5..ee11efb 100644 --- a/pyinfra/default_objects.py +++ b/pyinfra/default_objects.py @@ -54,6 +54,11 @@ def make_callback(analysis_endpoint): try: data, metadata = itemgetter("data", "metadata")(body) logging.debug(f"Requesting analysis from {endpoint}...") + # TODO: since data and metadata are passed as singletons, there is no buffering and hence no batching + # happening within the pipeline. However, the queue acknowledgment logic needs to be changed in order to + # facilitate passing non-singletons, to only ack a message, once a response is pulled from the output + # queue of the pipeline. Probably the pipeline return value needs to contains the queue message frame (or + # so), in order for the queue manager to tell which message to ack. analysis_response_stream = pipeline([data], [metadata]) return analysis_response_stream except Exception as err: