mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 17:21:02 +02:00
input/output is working
This commit is contained in:
parent
98faec7798
commit
60ca5aa3a6
8 changed files with 122 additions and 35 deletions
|
|
@ -11,11 +11,14 @@ class Configuration(dict):
|
|||
# one config service. Should be more than one, and use a
|
||||
# back-end state store.
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, push):
|
||||
|
||||
# Version counter
|
||||
self.version = 0
|
||||
|
||||
# External function to respond to update
|
||||
self.push = push
|
||||
|
||||
def __getitem__(self, key):
|
||||
if key not in self:
|
||||
self[key] = ConfigurationItems()
|
||||
|
|
@ -169,6 +172,8 @@ class Configuration(dict):
|
|||
|
||||
async def handle(self, msg):
|
||||
|
||||
print("Handle message ", msg.operation)
|
||||
|
||||
if msg.operation == "get":
|
||||
|
||||
resp = await self.handle_get(msg)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class Processor(AsyncProcessor):
|
|||
metrics = self.request_metrics,
|
||||
)
|
||||
|
||||
self.config = Configuration()
|
||||
self.config = Configuration(self.push)
|
||||
|
||||
print("Service initialised.")
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ class Processor(AsyncProcessor):
|
|||
|
||||
await self.push_pub.send(resp)
|
||||
|
||||
print("Pushed.")
|
||||
print("Pushed version ", self.config.version)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Processor(InputOutputProcessor):
|
|||
}
|
||||
)
|
||||
|
||||
print("PDF inited")
|
||||
print("PDF inited", flush=True)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue