Maint/asyncio (#305)

* Move to asyncio services, even though everything is largely sync
This commit is contained in:
cybermaggedon 2025-02-11 23:24:46 +00:00 committed by GitHub
parent a0bf2362f6
commit f350abb415
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 243 additions and 227 deletions

View file

@ -52,7 +52,7 @@ class Processor(ConsumerProducer):
subscriber=module + "-emb",
)
def handle(self, msg):
async def handle(self, msg):
v = msg.value()
print(f"Indexing {v.metadata.id}...", flush=True)
@ -73,7 +73,7 @@ class Processor(ConsumerProducer):
chunks=embeds,
)
self.producer.send(r)
await self.send(r)
except Exception as e:
print("Exception:", e, flush=True)
@ -105,5 +105,5 @@ class Processor(ConsumerProducer):
def run():
Processor.start(module, __doc__)
Processor.launch(module, __doc__)