mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 19:51:02 +02:00
Add concurrency to consumer spec
This commit is contained in:
parent
cb8017333e
commit
a068ca7127
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue