mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-18 17:51:02 +02:00
Request/response spec working, implemented in extract-defs and vertexai
This commit is contained in:
parent
36013212e0
commit
1047cd2fa1
22 changed files with 378 additions and 370 deletions
|
|
@ -51,30 +51,6 @@ class PulsarClient:
|
|||
if self.client:
|
||||
self.client.close()
|
||||
|
||||
def subscribe(self, queue, subscriber, schema,
|
||||
start_of_messages=False):
|
||||
|
||||
if start_of_messages:
|
||||
pos = pulsar.InitialPosition.Earliest
|
||||
else:
|
||||
pos = pulsar.InitialPosition.Latest
|
||||
|
||||
return self.client.subscribe(
|
||||
topic = queue,
|
||||
subscription_name = subscriber,
|
||||
consumer_type = pulsar.ConsumerType.Shared,
|
||||
schema = JsonSchema(schema),
|
||||
initial_position = pos,
|
||||
)
|
||||
|
||||
def publish(self, queue, schema):
|
||||
|
||||
return self.client.create_producer(
|
||||
topic=queue,
|
||||
schema=JsonSchema(schema),
|
||||
chunking_enabled=True,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def add_args(parser):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue