mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-06-04 12:25:13 +02:00
Maint/asyncio (#305)
* Move to asyncio services, even though everything is largely sync
This commit is contained in:
parent
a0bf2362f6
commit
f350abb415
60 changed files with 243 additions and 227 deletions
|
|
@ -39,7 +39,7 @@ class Processor(ConsumerProducer):
|
|||
|
||||
self.url = url
|
||||
|
||||
def handle(self, msg):
|
||||
async def handle(self, msg):
|
||||
|
||||
v = msg.value()
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ class Processor(ConsumerProducer):
|
|||
text=resp
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ class Processor(ConsumerProducer):
|
|||
),
|
||||
text=None,
|
||||
)
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
@ -98,5 +98,5 @@ class Processor(ConsumerProducer):
|
|||
|
||||
def run():
|
||||
|
||||
Processor.start(module, __doc__)
|
||||
Processor.launch(module, __doc__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue