Python stable · Mojo preview
Python + Mojo cheat sheet
Keep the stable Python wheel/API and the Mojo source-preview boundary in one place without merging their support claims.
Version and package
Terminal
python -m pip install --only-binary=:all: coakka-runtime-python==3.3.2- Connector
3.3.2: Core generation 3.3, connector revision 2.- Interpreter
- GIL-enabled CPython 3.11+.
- Native wheel targets
- macOS ARM64, Linux ARM64/x64, Windows ARM64/x64. Support claims need exact wheel + OS + CPU evidence.
- Owner name
RuntimeHostfor new code;ConnectorOrchestratoris the compatibility alias.
Embedded request/reply
Python
spec = ConnectorStartSpec(
system_name="orders",
node_id="orders-1",
routes=[local_route("orders.quote")],
)
with RuntimeHost.start(start_spec=spec) as runtime:
runtime.register_payload_handler("orders.quote", quote)
reply = runtime.ask_payload(
source="checkout",
target="orders.quote",
payload=b"2",
timeout_ms=2_000,
)Outcome and Deadletter
- Reply
ask_payload,ask_typedandask_jsonreturn a correlated terminal response.- Deadletter
DeadletterError.deadletterpreserves reason, original envelope, generation and delivery-failure facts.- Timeout/cancel
- A separate failure boundary; it does not prove the handler did not run.
- OneWay
send_one_way_*skips business response wait but retains admission/Monitor evidence.- Async terminal
submit_request_*+terminal_events()is a Python shape over the same Core contract.
Direct peer
Service
network=RuntimeNetworkConfig.network_node(
bind_host="0.0.0.0",
bind_port=19_321,
advertise_host="pricing.internal",
advertise_port=19_321,
)Caller
network=RuntimeNetworkConfig.outbound_only(),
routes=[RouteSpec(
target="orders.quote",
endpoints=[EndpointSpec(host="pricing.internal", port=19_321)],
strategy=RouteStrategy.SINGLE_OWNER,
)]File Lane and Stream Lane
- File: hash → receiver grant → sender submit → two terminal OK records → forget → close.
- Stream: publisher grant → subscriber window → bounded callbacks → two ENDED+OK records → forget → close.
- Grants pin an exact owner; do not load-balance them through a Service address.
memoryviewis borrowed only during the callback; copy before retaining.- Lane owners are independent from
RuntimeHost.
Monitor and effective state
enable_monitor=True- Startup intent.
monitor_is_enabled()- Core-accepted fact.
await_next_monitor(timeout_ms=...)- Bounded wait;
Nonemeans no signal in the window. runtime_startup_config()- Defaults and accepted construction facts.
runtime_config()/runtime_network_config()- Generation, routes, state, network and provenance.
Mojo preview
- Package
- Source archive
3.3.1, SHA-256a9b1a9cc78086d92d81294f7c1efa7e42c510f81df115d3830545bf5f143e5c1. - Toolchain
1.0.0b2.dev2026052115.- Boundary
- Thin Mojo executable → packaged C shim → CoAkka Runtime Core. No stable high-level Mojo API yet.
- Hosts
- macOS ARM64 and Raspberry Pi 5 Linux ARM64.
Integration checklist
- Pin the exact wheel in a virtual environment.
- One host for the process lifecycle; never per request.
- Bytes handlers return promptly; claim background errors before losing diagnostics.
- Do not parse exception text or deadletter detail.
- Read capabilities/effective state before advanced transport.
- Close lanes from an external owner, never reentrantly from a callback.