commit 8f5c6639c9762b214530993878e7a624da58d6ff
parent 1535fb9e738a8de6c2e4687475fbb33ddcfe952c
Author: Asher Morgan <asher@ashermorgan.net>
Date: Thu, 3 Sep 2026 18:47:27 -0700
Standardize names for AoH messages
Diffstat:
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/aoh/client.py b/aoh/client.py
@@ -114,8 +114,8 @@ def send_json_request(url, req_data=None, method='GET', cookies=''):
return status_code, headers, json.loads(data)
-def runner_update(url, cookies, data, keep_alive=False):
- """Submit runner updates and process core response fields."""
+def send_message(url, cookies, data, keep_alive=False):
+ """Send a message to the AoH runner and process core response fields."""
status, _, res = send_json_request(url, data, 'PUT', cookies)
@@ -141,15 +141,15 @@ def runner_update(url, cookies, data, keep_alive=False):
def runner_loop(runner_url, cookies):
- """Main execution loop."""
+ """Main runner loop."""
req = {}
while True:
- res = runner_update(runner_url, cookies, req)
+ res = send_message(runner_url, cookies, req)
if 'exec' in res:
- keep_alive_handler = lambda res=res: runner_update(
+ keep_alive_handler = lambda res=res: send_message(
runner_url,
cookies,
{ 'id': res['id'], 'keep-alive': True },
@@ -170,7 +170,7 @@ def runner_loop(runner_url, cookies):
def create_runner(playbook, args):
- """Main execution loop."""
+ """Create a runner and enter the runner loop."""
url = f'{API}/runners/{playbook}'
diff --git a/aoh/runner.py b/aoh/runner.py
@@ -144,8 +144,8 @@ class Runner:
self._t_finished < time.time() - threshold
- def process_client_request(self, req):
- """Process an AoH client request."""
+ def process_message(self, req):
+ """Process an AoH client message."""
with self._lock:
if self.id is None:
diff --git a/aoh/server.py b/aoh/server.py
@@ -90,7 +90,7 @@ def runner_update(path, short_id):
if runner.playbook.name != path:
return { 'err': f"Playbook not found: {path}" }, 400
- res = runner.process_client_request(request.json)
+ res = runner.process_message(request.json)
if res['finished']:
runner.teardown()