mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-28 00:35: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
|
|
@ -189,7 +189,7 @@ class Processor(ConsumerProducer):
|
|||
|
||||
return json.loads(json_str)
|
||||
|
||||
def handle(self, msg):
|
||||
async def handle(self, msg):
|
||||
|
||||
try:
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ class Processor(ConsumerProducer):
|
|||
observation=None,
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
def observe(x):
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ class Processor(ConsumerProducer):
|
|||
observation=x,
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
act = self.agent.react(v.question, history, think, observe)
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ class Processor(ConsumerProducer):
|
|||
thought=None,
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ class Processor(ConsumerProducer):
|
|||
]
|
||||
)
|
||||
|
||||
self.recursive_input.send(r, properties={"id": id})
|
||||
await self.recursive_input.send(r, properties={"id": id})
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ class Processor(ConsumerProducer):
|
|||
response=None,
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
|
||||
@staticmethod
|
||||
def add_args(parser):
|
||||
|
|
@ -377,5 +377,5 @@ description.'''
|
|||
|
||||
def run():
|
||||
|
||||
Processor.start(module, __doc__)
|
||||
Processor.launch(module, __doc__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue