Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new events #2692

Merged
merged 5 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/service/contact_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def handle_heartbeat(self, **kwargs):
self.log.debug("Agent %s can accept deadman abilities. Will return any available deadman abilities." %
agent.paw)
await agent.deadman(data_svc)
await self.get_service('event_svc').fire_event(exchange='agent', queue='added', agent=agent.display)
return agent, await self._get_instructions(agent)

async def build_filename(self):
Expand Down
2 changes: 2 additions & 0 deletions app/service/knowledge_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ def _load_module(module_type, module_info):

async def add_fact(self, fact, constraints=None):
if isinstance(fact, Fact):
await self.get_service('event_svc').fire_event(exchange='fact', queue='added', fact=fact.display, constraints=constraints)
return await self.__loaded_knowledge_module._add_fact(fact, constraints)

async def update_fact(self, criteria, updates):
await self.get_service('event_svc').fire_event(exchange='fact', queue='updated', criteria=criteria, updates=updates)
return await self.__loaded_knowledge_module._update_fact(criteria, updates)

async def get_facts(self, criteria, restrictions=None):
Expand Down
1 change: 1 addition & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def run_tasks(services):
loop.create_task(learning_svc.build_model())
loop.create_task(app_svc.watch_ability_files())
loop.run_until_complete(start_server())
loop.run_until_complete(event_svc.fire_event(exchange='system', queue='ready'))
try:
logging.info('All systems ready.')
loop.run_forever()
Expand Down