From c5e5460ca260d289823a41bafa6bc016ea9f9e75 Mon Sep 17 00:00:00 2001 From: Taylor Jacovich Date: Wed, 25 Mar 2026 08:40:59 -0400 Subject: [PATCH] Add priority parameter to apply_async call Allow attaching priority to `forward_message` messages. --- adsputils/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/adsputils/__init__.py b/adsputils/__init__.py index ddc1701..fdbb20f 100644 --- a/adsputils/__init__.py +++ b/adsputils/__init__.py @@ -453,13 +453,15 @@ def forward_message(self, *args, **kwargs): self.forward_message(message, pipeline=OUTPUT_PIPELINE) """ pipeline = kwargs.get('pipeline', 'default') - + + if not kwargs.get('priority', None): priority = None + if self.forward_message_dict and pipeline: if not self.forward_message_dict[pipeline].get('broker'): raise NotImplementedError('Sorry, your app is not properly configured (no broker).') forwarding_connection = BrokerConnection(self.forward_message_dict[pipeline].get('broker')) self.logger.debug('Forwarding results out to: %s', self.forward_message_dict[pipeline].get('broker')) - return self.forward_message_dict[pipeline]['forward message'].apply_async(args, kwargs, connection=forwarding_connection) + return self.forward_message_dict[pipeline]['forward message'].apply_async(args, kwargs, connection=forwarding_connection, priority=priority) else: raise NotImplementedError('Sorry, your app is not properly configured.')