input/output is working

This commit is contained in:
Cyber MacGeddon 2025-04-15 16:13:18 +01:00
parent 98faec7798
commit 60ca5aa3a6
8 changed files with 122 additions and 35 deletions

View file

@ -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)

View file

@ -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):

View file

@ -33,7 +33,7 @@ class Processor(InputOutputProcessor):
}
)
print("PDF inited")
print("PDF inited", flush=True)
async def on_message(self, msg, consumer):