mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-19 10:11:01 +02:00
input/output is working
This commit is contained in:
parent
98faec7798
commit
60ca5aa3a6
8 changed files with 122 additions and 35 deletions
|
|
@ -51,12 +51,18 @@ class PulsarClient:
|
|||
if self.client:
|
||||
self.client.close()
|
||||
|
||||
def subscribe(self, queue, subscriber, schema):
|
||||
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(
|
||||
queue, subscriber,
|
||||
consumer_type=pulsar.ConsumerType.Shared,
|
||||
schema=JsonSchema(schema),
|
||||
initial_position=pos,
|
||||
)
|
||||
|
||||
def publish(self, queue, schema):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue