Skip to content
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
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ Generic runtime mechanics:
- CxRP — orchestration contract
- a scheduler / queue system / fork manager / agent framework

## Runners (available in v0.1)
## Runners

| Runner | runtime_kind | What it does |
|---|---|---|
| `SubprocessRunner` | `subprocess` | Local subprocess with process-group safety. Default registered runner. |
| `ManualRunner` | `manual` | Forwards invocation to a caller-supplied dispatcher callable. For out-of-process services where ExecutorRuntime doesn't own the transport. |
| `HttpRunner` | `http` | Synchronous HTTP request/response. URL/method/body read from `RuntimeInvocation.metadata`. |
| `AsyncHttpRunner` | `http_async` | Async-shaped HTTP — kickoff (POST `→` 202 + run_id) then poll status URL until a terminal status. Sync from caller's POV. URL templates and JSON paths read from metadata. |

Async-shaped HTTP APIs (202 + poll/stream) are deferred — see backlog.
SSE streaming for async APIs is still deferred — track-able via the `runtime_kind` vocabulary if/when added.

## Example usage

Expand Down Expand Up @@ -98,6 +99,26 @@ runtime.register("http", HttpRunner())
result = runtime.run(invocation_with_runtime_kind_http)
```

### HTTP (async-shaped — 202 + poll)

```python
from executor_runtime import ExecutorRuntime
from executor_runtime.runners import AsyncHttpRunner

runtime = ExecutorRuntime()
runtime.register("http_async", AsyncHttpRunner())

# Invocation metadata carries:
# http.url — kickoff URL (POST endpoint, 202 → {"run_id": "..."})
# http.poll_url_template — e.g. "https://api/runs/{run_id}"
# http.poll_run_id_path — dotted path to extract run_id from kickoff response
# http.poll_status_path — dotted path to extract status from poll response
# http.poll_terminal_states — comma-separated, e.g. "completed,failed,cancelled"
# http.poll_success_states — subset (default: "completed")
# http.poll_interval_seconds — default 2.0
result = runtime.run(invocation_with_runtime_kind_http_async)
```

## Installation

```bash
Expand Down
2 changes: 2 additions & 0 deletions src/executor_runtime/runners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2026 Velascat
from executor_runtime.runners.async_http_runner import AsyncHttpRunner
from executor_runtime.runners.base import RuntimeRunner
from executor_runtime.runners.http_runner import HttpRunner
from executor_runtime.runners.manual_runner import Dispatcher, ManualRunner
Expand All @@ -11,4 +12,5 @@
"ManualRunner",
"Dispatcher",
"HttpRunner",
"AsyncHttpRunner",
]
Loading
Loading