Add concurrency to consumer spec

This commit is contained in:
Cyber MacGeddon 2025-06-04 10:47:33 +01:00
parent cb8017333e
commit a068ca7127

View file

@ -4,10 +4,11 @@ from . consumer import Consumer
from . spec import Spec
class ConsumerSpec(Spec):
def __init__(self, name, schema, handler):
def __init__(self, name, schema, handler, concurrency = 1):
self.name = name
self.schema = schema
self.handler = handler
self.concurrency = concurrency
def add(self, flow, processor, definition):
@ -24,6 +25,7 @@ class ConsumerSpec(Spec):
schema = self.schema,
handler = self.handler,
metrics = consumer_metrics,
concurrency = self.concurrency
)
# Consumer handle gets access to producers and other