mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11:03 +02:00
Enable chunking by default in producer
This commit is contained in:
parent
844547ab5f
commit
04e0b6953f
1 changed files with 7 additions and 2 deletions
|
|
@ -4,7 +4,9 @@ import asyncio
|
||||||
|
|
||||||
class Producer:
|
class Producer:
|
||||||
|
|
||||||
def __init__(self, client, topic, schema, metrics=None):
|
def __init__(self, client, topic, schema, metrics=None,
|
||||||
|
chunking_enabled=True):
|
||||||
|
|
||||||
self.client = client
|
self.client = client
|
||||||
self.topic = topic
|
self.topic = topic
|
||||||
self.schema = schema
|
self.schema = schema
|
||||||
|
|
@ -14,6 +16,8 @@ class Producer:
|
||||||
self.running = True
|
self.running = True
|
||||||
self.producer = None
|
self.producer = None
|
||||||
|
|
||||||
|
self.chunking_enabled = chunking_enabled
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
@ -38,7 +42,8 @@ class Producer:
|
||||||
print("Connect publisher to", self.topic, "...", flush=True)
|
print("Connect publisher to", self.topic, "...", flush=True)
|
||||||
self.producer = self.client.create_producer(
|
self.producer = self.client.create_producer(
|
||||||
topic = self.topic,
|
topic = self.topic,
|
||||||
schema = JsonSchema(self.schema)
|
schema = JsonSchema(self.schema),
|
||||||
|
chunking_enabled = self.chunking_enabled,
|
||||||
)
|
)
|
||||||
print("Connected to", self.topic, flush=True)
|
print("Connected to", self.topic, flush=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue